From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org.POSTED!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Ada and Unicode Date: Mon, 19 Apr 2021 02:08:35 -0700 Organization: Aioe.org NNTP Server Message-ID: <86mttuk5f0.fsf@stephe-leake.org> References: <607b5b20$0$27442$426a74cc@news.free.fr> NNTP-Posting-Host: pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:TXm+T2cwGUJ0+Spd6o4MYKC7QGw= Xref: reader02.eternal-september.org comp.lang.ada:61831 List-Id: DrPi <314@drpi.fr> writes: > Any way to use source code encoded in UTF-8 ? for Switches ("non_ascii.ads") use ("-gnatiw", "-gnatW8"); from the gnat user guide, 4.3.1 Alphabetical List of All Switches: `-gnati`c'' Identifier character set (`c' = 1/2/3/4/8/9/p/f/n/w). For details of the possible selections for `c', see *note Character Set Control: 4e. This applies to identifiers in the source code `-gnatW`e'' Wide character encoding method (`e'=n/h/u/s/e/8). This applies to string and character literals. > What's the way to manage Unicode correctly ? There are two issues: Unicode in source code, that the compiler must understand, and Unicode in strings, that your program must understand. (I've never written a program that dealt with utf strings other than file names). -gnati8 tells the compiler that the source code uses utf-8 encoding. -gnatW8 tells the compiler that string literals use utf-8 encoding. package Ada.Strings.UTF_Encoding provides some facilities for dealing with utf. It does _not_ provide walking a string by code point, which would seem necessary. We could be more helpful if you show what you are trying to do, you've tried, and what errors you got. -- -- Stephe