From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a84eaf8fb2470909 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!proxad.net!proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Ada generics From: Georg Bauhaus In-Reply-To: References: <1166710494.869393.108730@a3g2000cwd.googlegroups.com> <17fe4xfogg7p5.1dcyc5nyc2gsl.dlg@40tude.net> <1166805696.291429.239590@48g2000cwx.googlegroups.com> <186qujlcx6rwl.1h6eq4mbdaa5s$.dlg@40tude.net> <1167150212.165097.289010@73g2000cwn.googlegroups.com> <1qmdvus6du3xu.1n21tzgev46ia$.dlg@40tude.net> <1167246396.057028.325080@48g2000cwx.googlegroups.com> <15jxp8z1iu5fk.1oeihvavjghgg$.dlg@40tude.net> <1167327306.22163.66.camel@localhost> <1on3cinnnckc5.1rxxvjhxs5qzl.dlg@40tude.net> <1a9k0vk46bqrq.1cx6cdld0wd9f$.dlg@40tude.net> <67adnc2Fg68OzgHYnZ2dnUVZ_rylnZ2d@megapath.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-ID: <1168028046.28234.27.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Date: Fri, 05 Jan 2007 21:14:07 +0100 NNTP-Posting-Date: 05 Jan 2007 21:13:08 CET NNTP-Posting-Host: 56c64837.newsspool3.arcor-online.net X-Trace: DXC=hm`5G4\OB`;i6K;>iZ]763McF=Q^Z^V384Fo<]lROoR1gUcjd<3m<;2<4D49>d2bk>=kbmW`a1fG7C`2T@AUZfC;dP`TFfRM`H: X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8083 Date: 2007-01-05T21:13:08+01:00 List-Id: 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 }