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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e4abd14106db0029 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Ada 2012 and Unicode package (UTF-nn encodings handling) Date: Sun, 22 Aug 2010 20:51:24 +0200 Organization: Adalog Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 22 Aug 2010 18:51:26 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="z/xN1DBP8RUb+r9ug/i0hg"; logging-data="27517"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+HniJPnCM73BPrKk0BAw++" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 In-Reply-To: Cancel-Lock: sha1:TrV68QwMsTesRhYIGJMfLPkWil8= Xref: g2news1.google.com comp.lang.ada:13623 Date: 2010-08-22T20:51:24+02:00 List-Id: Le 21/08/2010 10:12, Yannick Duchêne (Hibou57) a écrit : > I just had a look back at > http://www.ada-auth.org/standards/12aarm/html/AA-A-4-11.html > Only Encode has this capability (via Output_BOM : Boolean). > Decode/Convert has nothing similar and will always skip any 16#FEFF# > which will be interpreted as a BOM instead of as a character (there is > nothing like an Interpret_BOM : Boolean). > > But may be I am missing something. Will have a deeper look at it and at > the AI which come with it (I saw UTF-32 was at least “pronounced” during > the talk). I think you missed the "Encoding" function. The intended usage (extracted from the !discussion section) is: 1) Read the first line. Call function Encoding on that line with an appropriate default to use if the line does not start with a BOM. Initialize the encoding scheme to the value returned by the function. 2) Decode all lines (including the first one) with the chosen encoding scheme. Since the BOM is ignored by Decode functions, it is not necessary to slice the first line specially. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr