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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5bcc293dc5642650 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.46.193 with SMTP id x1mr12089674pbm.7.1319132442396; Thu, 20 Oct 2011 10:40:42 -0700 (PDT) Path: d5ni36547pbc.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Why no Ada.Wide_Directories? Date: Thu, 20 Oct 2011 19:40:40 +0200 Organization: A noiseless patient Spider Message-ID: References: <9937871.172.1318575525468.JavaMail.geo-discussion-forums@prib32> <418b8140-fafb-442f-b91c-e22cc47f8adb@y22g2000pri.googlegroups.com> <7156122c-b63f-487e-ad1b-0edcc6694a7a@u10g2000prl.googlegroups.com> <409c81ab-bd54-493b-beb4-a0cca99ec306@p27g2000prp.googlegroups.com> Mime-Version: 1.0 Injection-Date: Thu, 20 Oct 2011 17:40:38 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="cJo7kSTQUrCFv2/D8KKtqw"; logging-data="29634"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+59/YBIxg0GOUxSpTZVlQL" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: Cancel-Lock: sha1:JC23OwSpePo1NQUBHoIfvXXfkjI= Xref: news2.google.com comp.lang.ada:14116 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: 2011-10-20T19:40:40+02:00 List-Id: Le 20/10/2011 09:37, Dmitry A. Kazakov a �crit : > On Wed, 19 Oct 2011 16:43:08 -0500, Randy Brukardt wrote: > >> > The only way to safely use a UTF-8 string is opaquely, which means you can >> > store it whole, but any operation on it is performed after decoding it. >> > That's of course the best argument for having it be a separate type. > Yes. It is worth to remember that Ada once was considered a strongly typed > language... > Different types represent things that are of different nature. It is not obvious that a difference in /encoding/ is sufficient to say that two things are of different nature. Consider also the problem with files. Is a UTF-8 file a text file? Do you want a UTF8_IO package? Normally, a UTF-8 file starts with a BOM in the first line, telling that the whole file is UTF8. How would you read that? Excerpt from AI137: --- When reading a file, a BOM can be expected as starting the first line of the file, but not subsequent lines. The proposed handling of BOM assumes the following pattern: 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. --- A possible alternative solution could be to make UTF_8_String a type derived from String (rather than a subtype). With conversions allowed, you would not lose Text_IO. I don't know if we'll have time to discuss this in Denver, but if you are serious about it, by all means get in touch with your standardization body and let them make a comment. There is no point in saying "that's how it should have been", and taking no action to that effect. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00