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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: XMLAda & unicode symbols Date: Sun, 20 Jun 2021 20:21:25 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 20 Jun 2021 18:21:25 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="242f0a9ff729e7a0a9564c4bd4266ae7"; logging-data="15827"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//m3KM+0zTY/6QlmTBlfkM3UJK27/VJlM=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 Cancel-Lock: sha1:MAdFLt/eTJnVEdlcBFBXhnhnJOA= In-Reply-To: <491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:62260 List-Id: On 6/20/21 7:02 PM, 196...@googlemail.com wrote: > On Saturday, 19 June 2021 at 20:53:49 UTC+1, Jeffrey R. Carter wrote: >> On 6/19/21 8:28 PM, 196...@googlemail.com wrote: >>> I'm creating SVG files with XMLAda and I need to have a degree symbol within some text. >>> >>> I have: >>> procedure Add_Min_Max (Min_Max_Str : String; X_Pos : String; Y_Pos : String) is >> The degree symbol is part of Latin-1, so why not include it directly in your string? >> >> S : constant String := "50" & Ada.Characters.Handling.Latin_1.Degree_Sign; >> >> -- >> Jeff Carter >> "I would never want to belong to any club that >> would have someone like me for a member." >> Annie Hall >> 41 > > Unfortunately, when XMLAda comes to exporting the DOM tree, it crashed with: > raised UNICODE.CES.INVALID_ENCODING : unicode-ces-utf8.adb:258 I would call that an error in XMLAda. Anything that uses String should accept any String. The exception name indicates that XMLAda is probably misusing String to hold encoded Unicode text, probably with UTF-8 encoding. Any use of String as anything other than its intended use, as a sequence of Latin-1 characters, is a mistake. -- Jeff Carter "Help! Help! I'm being repressed!" Monty Python & the Holy Grail 67