comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@arcor.de>
Subject: Re: Ada generics
Date: Fri, 05 Jan 2007 21:14:07 +0100
Date: 2007-01-05T21:13:08+01:00	[thread overview]
Message-ID: <1168028046.28234.27.camel@localhost> (raw)
In-Reply-To: <hbydnaCQY4LhNwDYnZ2dnUVZ_qisnZ2d@megapath.net>

On Thu, 2007-01-04 at 19:32 -0600, Randy Brukardt wrote:

> If that is a real concern, just insist that all of your programs are edited
> with a 1984-vintage MS-DOS editor (like I do ;-), and you won't possibly be
> able to have a problem. Indeed, I expect most programmers will continue to
> do this (use tools that don't support Unicode), so any new problems will be
> limited.

Maybe there is a chance that UTF-8 will show its advantages in
a trouble free transition from Latin-1 to UTF-8 where possible
(string literals made for 8bit character set displays might need
attention, I guess).
First, many tools can use UTF-8 files: Anything based on Eclipse works
well with UTF-8, GPS does, and VS.NET uses UTF-8 in all sorts of places.
VIM works just fine with UTF-8 files, and Emacs, having started
from the more general MULE character system supports Unicode, too,
in recent editions.

Second, recoding files from Latin-1 to UTF-8 should be no more than
a small shell script invoking the iconv tool, and then looking
at string literals in files that need to be ISO-8859-X encoded.
FWIW, 

#! /bin/sh
# Functions to help with the creation of UTF-8 Ada files from Latin-1
# Ada files
# Needs: grep, mawk (AWK that supports \ooo notation for characters)

ada_pat='\.\(ads\|adb\|ada\|spc\|bdy\)'
   # regular expression describing file name extensions of Ada files

repl_in_dir()
{
   # Copy Ada files from $1 to $2, replacing ISO-8859-1 characters with
   # corresponding UTF-8 characters. Call with two full paths.

   source=$1
   target=$2
   here=$(pwd)  # save current directory
   cd $source
   ls | grep "${ada_pat}$" | while read file
   do
      cat $file | iconv -f ISO_8859-1  -t UTF-8 > $target/$file
   done
   cd $here
}


check_strings()
{
   # List string literals X that have Character'pos(X(k)) > 8#177#
   # Run this in a directory of Ada files. Output is prefixed with
   # file name and line number.

   ls | grep "${ada_pat}$" | while read file
   do
      cat $file | { env FILENAME=$file mawk '
                      BEGIN  { OFS=":" }
                      /"[\000-\177]*[^\000-\177]/ {
                            print ENVIRON["FILENAME"],NR, $0
                      }'
                  }
   done
}






  parent reply	other threads:[~2007-01-05 20:14 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21 14:14 Ada generics markww
2006-12-21 15:42 ` Dmitry A. Kazakov
2006-12-22  7:59   ` Martin Krischik
2006-12-22 16:14     ` Hyman Rosen
2006-12-22  7:59   ` Martin Krischik
2006-12-22 16:41   ` Hyman Rosen
2006-12-22 17:33     ` Markus E Leypold
2006-12-22 18:26       ` Hyman Rosen
2006-12-22 20:59         ` Markus E Leypold
2006-12-22 21:01           ` Markus E Leypold
2006-12-23 14:09           ` Marco
2006-12-25 14:23             ` Hyman Rosen
2006-12-29 14:13               ` Marco
2006-12-25 14:20           ` Hyman Rosen
2006-12-23 11:43     ` Dmitry A. Kazakov
2006-12-25 13:49       ` Hyman Rosen
2006-12-25 14:39         ` Dmitry A. Kazakov
2006-12-26  1:34           ` Hyman Rosen
2006-12-26  9:11             ` Dmitry A. Kazakov
2006-12-26 16:23               ` Hyman Rosen
2006-12-26 19:28                 ` Dmitry A. Kazakov
2006-12-27  1:44                   ` Hyman Rosen
2006-12-27  9:21                     ` Dmitry A. Kazakov
2006-12-27 19:06                       ` Hyman Rosen
2006-12-28 10:59                         ` Dmitry A. Kazakov
2006-12-28 16:29                           ` Hyman Rosen
2006-12-29 11:12                             ` Dmitry A. Kazakov
2006-12-29 14:56                               ` Hyman Rosen
2006-12-28 17:35                           ` Georg Bauhaus
2006-12-29 14:48                             ` Dmitry A. Kazakov
2006-12-29 19:39                               ` Georg Bauhaus
2006-12-30  9:58                                 ` Dmitry A. Kazakov
2006-12-30 14:53                                   ` Georg Bauhaus
2007-01-01 13:00                                     ` Dmitry A. Kazakov
2007-01-02 10:04                                       ` Georg Bauhaus
2007-01-02 11:11                                         ` Dmitry A. Kazakov
2007-01-02 12:33                                           ` Georg Bauhaus
2007-01-02 13:51                                             ` Dmitry A. Kazakov
2007-01-02 14:45                                               ` Georg Bauhaus
2007-01-03 10:10                                                 ` Dmitry A. Kazakov
2007-01-03 14:20                                                   ` Hyman Rosen
2007-01-03 14:55                                                   ` Georg Bauhaus
2007-01-04 10:15                                                     ` Dmitry A. Kazakov
2007-01-03 19:33                                           ` Alexander E. Kopilovich
2007-01-04 10:27                                             ` Dmitry A. Kazakov
2007-01-04 15:00                                               ` Alexander E. Kopilovich
2007-01-05 10:32                                                 ` Dmitry A. Kazakov
2006-12-30  2:25                               ` Randy Brukardt
2006-12-30 10:13                                 ` Dmitry A. Kazakov
2007-01-04  1:09                                   ` Randy Brukardt
2007-01-04 10:07                                     ` Dmitry A. Kazakov
2007-01-05  1:32                                       ` Randy Brukardt
2007-01-05  4:46                                         ` Randy Brukardt
2007-01-05  9:08                                         ` Jean-Pierre Rosen
2007-01-05 20:14                                         ` Georg Bauhaus [this message]
2007-01-06  0:14                                           ` Randy Brukardt
2006-12-29  0:09                           ` Randy Brukardt
2006-12-29 11:11                             ` Dmitry A. Kazakov
2006-12-30  2:40                               ` Randy Brukardt
2006-12-21 16:55 ` Hyman Rosen
2006-12-21 18:22   ` markww
2006-12-22  3:01 ` Steve
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox