Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Matter will be damaged in direct proportion to its value.


devel / comp.lang.ada / XMLAda & unicode symbols

SubjectAuthor
* XMLAda & unicode symbols196...@googlemail.com
+* Re: XMLAda & unicode symbolsJeffrey R. Carter
|`* Re: XMLAda & unicode symbols196...@googlemail.com
| +* Re: XMLAda & unicode symbolsDmitry A. Kazakov
| |`* Re: XMLAda & unicode symbols196...@googlemail.com
| | +* Re: XMLAda & unicode symbolsDmitry A. Kazakov
| | |`* Re: XMLAda & unicode symbols196...@googlemail.com
| | | `- Re: XMLAda & unicode symbolsDmitry A. Kazakov
| | `* Re: XMLAda & unicode symbolsSimon Wright
| |  `* Re: XMLAda & unicode symbols196...@googlemail.com
| |   +- Re: XMLAda & unicode symbolsDmitry A. Kazakov
| |   +- Re: XMLAda & unicode symbolsSimon Wright
| |   `- Re: XMLAda & unicode symbolsSpiros Bousbouras
| `* Re: XMLAda & unicode symbolsJeffrey R. Carter
|  `* Re: XMLAda & unicode symbolsDmitry A. Kazakov
|   `* Re: XMLAda & unicode symbolsJeffrey R. Carter
|    +* Re: XMLAda & unicode symbolsMarius Amado-Alves
|    |`- Re: XMLAda & unicode symbolsJeffrey R. Carter
|    `- Re: XMLAda & unicode symbolsDmitry A. Kazakov
+* Re: XMLAda & unicode symbolsSimon Wright
|`* Re: XMLAda & unicode symbols196...@googlemail.com
| `* Re: XMLAda & unicode symbolsSimon Wright
|  +* Re: XMLAda & unicode symbolsEmmanuel Briot
|  |+- Re: XMLAda & unicode symbols196...@googlemail.com
|  |`* Re: XMLAda & unicode symbolsSimon Wright
|  | `- Re: XMLAda & unicode symbolsEmmanuel Briot
|  `- Re: XMLAda & unicode symbolsSimon Wright
`- Re: XMLAda & unicode symbolsVadim Godunko

Pages:12
XMLAda & unicode symbols

<f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5432&group=comp.lang.ada#5432

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:15d3:: with SMTP id o19mr15064581qkm.481.1624127334830;
Sat, 19 Jun 2021 11:28:54 -0700 (PDT)
X-Received: by 2002:a25:b90:: with SMTP id 138mr10218602ybl.161.1624127334426;
Sat, 19 Jun 2021 11:28:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 19 Jun 2021 11:28:54 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8b0:ca:6:0:0:0:fd;
posting-account=TiHetgoAAACluCgYkPc8-TWs6dBNgSne
NNTP-Posting-Host: 2001:8b0:ca:6:0:0:0:fd
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
Subject: XMLAda & unicode symbols
From: 1963...@googlemail.com (196...@googlemail.com)
Injection-Date: Sat, 19 Jun 2021 18:28:54 +0000
Content-Type: text/plain; charset="UTF-8"
 by: 196...@googlemail.co - Sat, 19 Jun 2021 18:28 UTC

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
Text_Node : DOM.Core.Element;
Text : DOM.Core.Text;
begin
Text_Node := DOM.Core.Documents.Create_Element (LDocument, "text");
DOM.Core.Elements.Set_Attribute (Text_Node, "x", X_Pos);
DOM.Core.Elements.Set_Attribute (Text_Node, "y", Y_Pos);
DOM.Core.Elements.Set_Attribute (Text_Node, "class", "def-maroon");
DOM.Core.Elements.Set_Attribute (Text_Node, "text-anchor", "left");
Text_Node := DOM.Core.Nodes.Append_Child (Root_Node, Text_Node);
Text := DOM.Core.Documents.Create_Text_Node (LDocument, Min_Max_Str);
Text := DOM.Core.Nodes.Append_Child (Text_Node, Text);
end Add_Min_Max;

and I just pass a string in. The degree symbol is unicode 00B0 and you would then normally have it as &#00B0, except if I do, then XMLAda changes that initial '&' to '&amp' and so what is then coded is '&amp#00B0' and it fails to display properly.

Nor can I apply Unicode.Names.Latin_1_Supplement.Degree_Sign to the string, since, well, strict typing...

To me it seems like XMLAda is being far too eager and is not willing to just publish what I enter.

I raised a call on the github repository, but it was closed saying basically use the unicode name, which fails.

Does anyone have a clue how this can be done?

Re: XMLAda & unicode symbols

<sali0b$hf8$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5433&group=comp.lang.ada#5433

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: spam.jrc...@spam.not.acm.org (Jeffrey R. Carter)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Sat, 19 Jun 2021 21:53:47 +0200
Organization: Also freenews.netfront.net; news.tornevall.net;
news.eternal-september.org
Lines: 16
Message-ID: <sali0b$hf8$1@dont-email.me>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 19 Jun 2021 19:53:47 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4e33f0409ad57288c291a058b1a521a4";
logging-data="17896"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18A5lTm38G6Ld0g55mdqQYlMtA49F3uwQg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
Cancel-Lock: sha1:/Oj39Un2PKfPUvjvSX49SuvG/yQ=
In-Reply-To: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
Content-Language: en-US
 by: Jeffrey R. Carter - Sat, 19 Jun 2021 19:53 UTC

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

Re: XMLAda & unicode symbols

<lyk0mph7j6.fsf@pushface.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5434&group=comp.lang.ada#5434

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!yy9MKEJN2ULhWGfnfq4v5w.user.gioia.aioe.org.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Sat, 19 Jun 2021 22:24:45 +0100
Organization: Aioe.org NNTP Server
Lines: 68
Message-ID: <lyk0mph7j6.fsf@pushface.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
NNTP-Posting-Host: yy9MKEJN2ULhWGfnfq4v5w.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 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:2qLhfpcOkHJIYWz16Z0QfQAilig=
 by: Simon Wright - Sat, 19 Jun 2021 21:24 UTC

"196...@googlemail.com" <1963bib@googlemail.com> writes:

> 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
> Text_Node : DOM.Core.Element;
> Text : DOM.Core.Text;
> begin
> Text_Node := DOM.Core.Documents.Create_Element (LDocument, "text");
> DOM.Core.Elements.Set_Attribute (Text_Node, "x", X_Pos);
> DOM.Core.Elements.Set_Attribute (Text_Node, "y", Y_Pos);
> DOM.Core.Elements.Set_Attribute (Text_Node, "class", "def-maroon");
> DOM.Core.Elements.Set_Attribute (Text_Node, "text-anchor", "left");
> Text_Node := DOM.Core.Nodes.Append_Child (Root_Node, Text_Node);
> Text := DOM.Core.Documents.Create_Text_Node (LDocument, Min_Max_Str);
> Text := DOM.Core.Nodes.Append_Child (Text_Node, Text);
> end Add_Min_Max;
>
> and I just pass a string in. The degree symbol is unicode 00B0 and you
> would then normally have it as &#00B0, except if I do, then XMLAda
> changes that initial '&' to '&amp' and so what is then coded is
> '&amp#00B0' and it fails to display properly.
>
> Nor can I apply Unicode.Names.Latin_1_Supplement.Degree_Sign to the
> string, since, well, strict typing...
>
> To me it seems like XMLAda is being far too eager and is not willing
> to just publish what I enter.
>
> I raised a call on the github repository, but it was closed saying
> basically use the unicode name, which fails.

Set_Attribute takes a Dom_String, which is a subtype of
Unicode.CES.Byte_Sequence, which is a subtype of String. The question
is, what encoding? I suspect it's utf-8, so we need to encode
Ada.Characters.Latin_1.Degree_Sign in utf-8, & this code using XML/Ada
support seems to do the trick:

with Ada.Characters.Latin_1;
with Ada.Text_IO;
with Unicode.CES;
with Unicode.Encodings;
procedure Conversion is
Fifty_Degrees_Latin1 : constant String
:= "50" & Ada.Characters.Latin_1.Degree_Sign;
Fifty_Degrees_UTF8 : constant Unicode.CES.Byte_Sequence
:= "50"
& Unicode.Encodings.Convert
((1 => Ada.Characters.Latin_1.Degree_Sign),
From => Unicode.Encodings.Get_By_Name ("iso-8859-15"),
To => Unicode.Encodings.Get_By_Name ("utf-8"));
begin
Ada.Text_IO.Put_Line (Fifty_Degrees_Latin1);
Ada.Text_IO.Put_Line (Fifty_Degrees_UTF8);
end Conversion;

(note that Convert's From and To parameters are the default). On this
Mac (Terminal displays utf-8 text) the first line is garbage, the second
fine.

I'm So Wildly Impressed (maybe "cast down" would be more accurate) by
all that subtyping in our wondrously safe language.

I also agree with you that suggesting you use a Unicode_Char
(Wide_Wide_Character) without saying *how* is less helpful than it could
be.

Re: XMLAda & unicode symbols

<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5438&group=comp.lang.ada#5438

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a0c:e18c:: with SMTP id p12mr7429155qvl.54.1624208527107; Sun, 20 Jun 2021 10:02:07 -0700 (PDT)
X-Received: by 2002:a25:e658:: with SMTP id d85mr27692995ybh.165.1624208526945; Sun, 20 Jun 2021 10:02:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 20 Jun 2021 10:02:06 -0700 (PDT)
In-Reply-To: <sali0b$hf8$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8b0:ca:6:0:0:0:fd; posting-account=TiHetgoAAACluCgYkPc8-TWs6dBNgSne
NNTP-Posting-Host: 2001:8b0:ca:6:0:0:0:fd
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com> <sali0b$hf8$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
Subject: Re: XMLAda & unicode symbols
From: 1963...@googlemail.com (196...@googlemail.com)
Injection-Date: Sun, 20 Jun 2021 17:02:07 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 18
 by: 196...@googlemail.co - Sun, 20 Jun 2021 17:02 UTC

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

Re: XMLAda & unicode symbols

<b4c0edbd-7567-47cb-ba75-2fa27d75a788n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5439&group=comp.lang.ada#5439

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a0c:bf4b:: with SMTP id b11mr16040109qvj.11.1624209009056; Sun, 20 Jun 2021 10:10:09 -0700 (PDT)
X-Received: by 2002:a25:b90:: with SMTP id 138mr15745274ybl.161.1624209008916; Sun, 20 Jun 2021 10:10:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 20 Jun 2021 10:10:08 -0700 (PDT)
In-Reply-To: <lyk0mph7j6.fsf@pushface.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8b0:ca:6:0:0:0:fd; posting-account=TiHetgoAAACluCgYkPc8-TWs6dBNgSne
NNTP-Posting-Host: 2001:8b0:ca:6:0:0:0:fd
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com> <lyk0mph7j6.fsf@pushface.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b4c0edbd-7567-47cb-ba75-2fa27d75a788n@googlegroups.com>
Subject: Re: XMLAda & unicode symbols
From: 1963...@googlemail.com (196...@googlemail.com)
Injection-Date: Sun, 20 Jun 2021 17:10:09 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 78
 by: 196...@googlemail.co - Sun, 20 Jun 2021 17:10 UTC

On Saturday, 19 June 2021 at 22:24:47 UTC+1, Simon Wright wrote:
> "196...@googlemail.com" <196...@googlemail.com> writes:
>
> > 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
> > Text_Node : DOM.Core.Element;
> > Text : DOM.Core.Text;
> > begin
> > Text_Node := DOM.Core.Documents.Create_Element (LDocument, "text");
> > DOM.Core.Elements.Set_Attribute (Text_Node, "x", X_Pos);
> > DOM.Core.Elements.Set_Attribute (Text_Node, "y", Y_Pos);
> > DOM.Core.Elements.Set_Attribute (Text_Node, "class", "def-maroon");
> > DOM.Core.Elements.Set_Attribute (Text_Node, "text-anchor", "left");
> > Text_Node := DOM.Core.Nodes.Append_Child (Root_Node, Text_Node);
> > Text := DOM.Core.Documents.Create_Text_Node (LDocument, Min_Max_Str);
> > Text := DOM.Core.Nodes.Append_Child (Text_Node, Text);
> > end Add_Min_Max;
> >
> > and I just pass a string in. The degree symbol is unicode 00B0 and you
> > would then normally have it as &#00B0, except if I do, then XMLAda
> > changes that initial '&' to '&amp' and so what is then coded is
> > '&amp#00B0' and it fails to display properly.
> >
> > Nor can I apply Unicode.Names.Latin_1_Supplement.Degree_Sign to the
> > string, since, well, strict typing...
> >
> > To me it seems like XMLAda is being far too eager and is not willing
> > to just publish what I enter.
> >
> > I raised a call on the github repository, but it was closed saying
> > basically use the unicode name, which fails.
> Set_Attribute takes a Dom_String, which is a subtype of
> Unicode.CES.Byte_Sequence, which is a subtype of String. The question
> is, what encoding? I suspect it's utf-8, so we need to encode
> Ada.Characters.Latin_1.Degree_Sign in utf-8, & this code using XML/Ada
> support seems to do the trick:
>
> with Ada.Characters.Latin_1;
> with Ada.Text_IO;
> with Unicode.CES;
> with Unicode.Encodings;
> procedure Conversion is
> Fifty_Degrees_Latin1 : constant String
> := "50" & Ada.Characters.Latin_1.Degree_Sign;
> Fifty_Degrees_UTF8 : constant Unicode.CES.Byte_Sequence
> := "50"
> & Unicode.Encodings.Convert
> ((1 => Ada.Characters.Latin_1.Degree_Sign),
> From => Unicode.Encodings.Get_By_Name ("iso-8859-15"),
> To => Unicode.Encodings.Get_By_Name ("utf-8"));
> begin
> Ada.Text_IO.Put_Line (Fifty_Degrees_Latin1);
> Ada.Text_IO.Put_Line (Fifty_Degrees_UTF8);
> end Conversion;
>
> (note that Convert's From and To parameters are the default). On this
> Mac (Terminal displays utf-8 text) the first line is garbage, the second
> fine.
>
> I'm So Wildly Impressed (maybe "cast down" would be more accurate) by
> all that subtyping in our wondrously safe language.
>
> I also agree with you that suggesting you use a Unicode_Char
> (Wide_Wide_Character) without saying *how* is less helpful than it could
> be.

Asking for the degree sign, was probably a slight mistake. There is Degree_Celsius and also Degree_Fahrenheit for those who have not yet embraced metric. These are the "correct" symbols.

Both of these exist in Unicode.Names.Letterlike_Symbols, and probably elsewhere,but trying to shoehorn these in seems impossible.

I just wish XMLAda could just accept whatever we throw at it, and if we need to convert it, then let us do so outside of it.

Using Text_IO is fine, but not where XMLAda is concerned.

B

Re: XMLAda & unicode symbols

<santij$akg$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5440&group=comp.lang.ada#5440

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Sun, 20 Jun 2021 19:23:35 +0200
Organization: Aioe.org NNTP Server
Lines: 23
Message-ID: <santij$akg$1@gioia.aioe.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Sun, 20 Jun 2021 17:23 UTC

On 2021-06-20 19:02, 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;
>
> Unfortunately, when XMLAda comes to exporting the DOM tree, it crashed with:
> raised UNICODE.CES.INVALID_ENCODING : unicode-ces-utf8.adb:258

Maybe it expects UTF-8, as most third party Ada libraries do. In that
case use:

Character'Val (16#C2#) & Character'Val (16#B0#)

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: XMLAda & unicode symbols

<874bd6ad-df44-4d63-bb6c-9d2941781e6en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5441&group=comp.lang.ada#5441

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:414a:: with SMTP id k10mr18842271qko.37.1624211921315;
Sun, 20 Jun 2021 10:58:41 -0700 (PDT)
X-Received: by 2002:a25:75d6:: with SMTP id q205mr25672273ybc.339.1624211921150;
Sun, 20 Jun 2021 10:58:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 20 Jun 2021 10:58:40 -0700 (PDT)
In-Reply-To: <santij$akg$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8b0:ca:6:0:0:0:fd;
posting-account=TiHetgoAAACluCgYkPc8-TWs6dBNgSne
NNTP-Posting-Host: 2001:8b0:ca:6:0:0:0:fd
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me> <491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<santij$akg$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <874bd6ad-df44-4d63-bb6c-9d2941781e6en@googlegroups.com>
Subject: Re: XMLAda & unicode symbols
From: 1963...@googlemail.com (196...@googlemail.com)
Injection-Date: Sun, 20 Jun 2021 17:58:41 +0000
Content-Type: text/plain; charset="UTF-8"
 by: 196...@googlemail.co - Sun, 20 Jun 2021 17:58 UTC

On Sunday, 20 June 2021 at 18:23:35 UTC+1, Dmitry A. Kazakov wrote:
> On 2021-06-20 19:02, 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;
> >
> > Unfortunately, when XMLAda comes to exporting the DOM tree, it crashed with:
> > raised UNICODE.CES.INVALID_ENCODING : unicode-ces-utf8.adb:258
> Maybe it expects UTF-8, as most third party Ada libraries do. In that
> case use:
>
> Character'Val (16#C2#) & Character'Val (16#B0#)

That's the degree symbol, what I really need is the degree centigrade symbol which is U+2103.

Having Character'Val (16#21#) & Character'Val (16#03#) fails at runtime.

I'm sure it's easy enough, and when I get it, I'll be banging my head against the desk.

Re: XMLAda & unicode symbols

<sao0ml$1lm1$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5442&group=comp.lang.ada#5442

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Sun, 20 Jun 2021 20:16:57 +0200
Organization: Aioe.org NNTP Server
Lines: 35
Message-ID: <sao0ml$1lm1$1@gioia.aioe.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<santij$akg$1@gioia.aioe.org>
<874bd6ad-df44-4d63-bb6c-9d2941781e6en@googlegroups.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Sun, 20 Jun 2021 18:16 UTC

On 2021-06-20 19:58, 196...@googlemail.com wrote:
> On Sunday, 20 June 2021 at 18:23:35 UTC+1, Dmitry A. Kazakov wrote:
>> On 2021-06-20 19:02, 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;
>>>
>>> Unfortunately, when XMLAda comes to exporting the DOM tree, it crashed with:
>>> raised UNICODE.CES.INVALID_ENCODING : unicode-ces-utf8.adb:258
>> Maybe it expects UTF-8, as most third party Ada libraries do. In that
>> case use:
>>
>> Character'Val (16#C2#) & Character'Val (16#B0#)
>
> That's the degree symbol, what I really need is the degree centigrade symbol which is U+2103.
>
> Having Character'Val (16#21#) & Character'Val (16#03#) fails at runtime.
>
> I'm sure it's easy enough, and when I get it, I'll be banging my head against the desk.

Why do you use XMLAda? SVG is a text file, I would write directly. It is
the reverse, rendering SVG image, that is difficult to write from scratch.

And why do you want to create SVG files?

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: XMLAda & unicode symbols

<sao0v5$fej$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5443&group=comp.lang.ada#5443

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: spam.jrc...@spam.not.acm.org (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
Lines: 34
Message-ID: <sao0v5$fej$1@dont-email.me>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<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
 by: Jeffrey R. Carter - Sun, 20 Jun 2021 18:21 UTC

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

Re: XMLAda & unicode symbols

<sao2fn$fpp$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5444&group=comp.lang.ada#5444

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Sun, 20 Jun 2021 20:47:23 +0200
Organization: Aioe.org NNTP Server
Lines: 15
Message-ID: <sao2fn$fpp$1@gioia.aioe.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<sao0v5$fej$1@dont-email.me>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Sun, 20 Jun 2021 18:47 UTC

On 2021-06-20 20:21, Jeffrey R. Carter wrote:

> 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.

That ship has sailed. I would say that any use of String as Latin-1 is a
mistake now because most of the libraries would use UTF-8 encoding
instead of Latin-1. Latin is a dead language, you know... (:-))

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: XMLAda & unicode symbols

<saogms$qdj$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5445&group=comp.lang.ada#5445

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: spam.jrc...@spam.not.acm.org (Jeffrey R. Carter)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Mon, 21 Jun 2021 00:50:02 +0200
Organization: Also freenews.netfront.net; news.tornevall.net;
news.eternal-september.org
Lines: 18
Message-ID: <saogms$qdj$1@dont-email.me>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<sao0v5$fej$1@dont-email.me> <sao2fn$fpp$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Jun 2021 22:50:04 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="5d6af5b2024c48caeab8e64f2098b02a";
logging-data="27059"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18PZAt+PDJbMnVdvTURkfNSVNpvJO0U/uk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
Cancel-Lock: sha1:UY4jRk/lzzKZE7XjBefpsDgi1Ho=
In-Reply-To: <sao2fn$fpp$1@gioia.aioe.org>
Content-Language: en-US
 by: Jeffrey R. Carter - Sun, 20 Jun 2021 22:50 UTC

On 6/20/21 8:47 PM, Dmitry A. Kazakov wrote:
> On 2021-06-20 20:21, Jeffrey R. Carter wrote:
>
> That ship has sailed. I would say that any use of String as Latin-1 is a mistake
> now because most of the libraries would use UTF-8 encoding instead of Latin-1.

I have never subscribed to the illogic that if enough people make the same
mistake, it ceases to be a mistake.

> Latin is a dead language, you know... (:-))

Some people still speak it. No one has ever spoken Unicode.

--
Jeff Carter
"Help! Help! I'm being repressed!"
Monty Python & the Holy Grail
67

Re: XMLAda & unicode symbols

<36e54933-06e2-4087-a4d8-77653a4e6a5bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5446&group=comp.lang.ada#5446

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:5e4f:: with SMTP id i15mr22114459qtx.362.1624248981518;
Sun, 20 Jun 2021 21:16:21 -0700 (PDT)
X-Received: by 2002:a25:745:: with SMTP id 66mr29698125ybh.363.1624248981352;
Sun, 20 Jun 2021 21:16:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 20 Jun 2021 21:16:21 -0700 (PDT)
In-Reply-To: <saogms$qdj$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=94.60.6.132; posting-account=3cDqWgoAAAAZXc8D3pDqwa77IryJ2nnY
NNTP-Posting-Host: 94.60.6.132
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me> <491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<sao0v5$fej$1@dont-email.me> <sao2fn$fpp$1@gioia.aioe.org> <saogms$qdj$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <36e54933-06e2-4087-a4d8-77653a4e6a5bn@googlegroups.com>
Subject: Re: XMLAda & unicode symbols
From: amado.al...@gmail.com (Marius Amado-Alves)
Injection-Date: Mon, 21 Jun 2021 04:16:21 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Marius Amado-Alves - Mon, 21 Jun 2021 04:16 UTC

> No one has ever spoken Unicode.

Tell that to the billions of speakers using the thousands of languages written in the hundreds of Unicode scripts.

Re: XMLAda & unicode symbols

<2359d648-4409-4d5f-8bb3-13187ceff984n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5447&group=comp.lang.ada#5447

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:1003:: with SMTP id z3mr22116790qkj.490.1624255623028; Sun, 20 Jun 2021 23:07:03 -0700 (PDT)
X-Received: by 2002:a25:afcd:: with SMTP id d13mr29636259ybj.504.1624255622769; Sun, 20 Jun 2021 23:07:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 20 Jun 2021 23:07:02 -0700 (PDT)
In-Reply-To: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.59.149.45; posting-account=niG3UgoAAAD7iQ3takWjEn_gw6D9X3ww
NNTP-Posting-Host: 5.59.149.45
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2359d648-4409-4d5f-8bb3-13187ceff984n@googlegroups.com>
Subject: Re: XMLAda & unicode symbols
From: vgodu...@gmail.com (Vadim Godunko)
Injection-Date: Mon, 21 Jun 2021 06:07:03 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 2
 by: Vadim Godunko - Mon, 21 Jun 2021 06:07 UTC

There is another library which can generate XML documents and use real Unicode for all data manipulations, see XML writer example in Matreshka:

http://forge.ada-ru.org/matreshka/wiki/XML/SAX

Re: XMLAda & unicode symbols

<sapap2$ks2$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5448&group=comp.lang.ada#5448

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Mon, 21 Jun 2021 08:14:58 +0200
Organization: Aioe.org NNTP Server
Lines: 18
Message-ID: <sapap2$ks2$1@gioia.aioe.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<sao0v5$fej$1@dont-email.me> <sao2fn$fpp$1@gioia.aioe.org>
<saogms$qdj$1@dont-email.me>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Mon, 21 Jun 2021 06:14 UTC

On 2021-06-21 00:50, Jeffrey R. Carter wrote:
> On 6/20/21 8:47 PM, Dmitry A. Kazakov wrote:
>> On 2021-06-20 20:21, Jeffrey R. Carter wrote:
>>
>> That ship has sailed. I would say that any use of String as Latin-1 is
>> a mistake now because most of the libraries would use UTF-8 encoding
>> instead of Latin-1.
>
> I have never subscribed to the illogic that if enough people make the
> same mistake, it ceases to be a mistake.

The mistake is on the Ada type system design side. People repurposed
Latin-1 strings for UTF-8 strings because there was no other feasible way.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: XMLAda & unicode symbols

<sapmoo$1q8$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5449&group=comp.lang.ada#5449

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: spam.jrc...@spam.not.acm.org (Jeffrey R. Carter)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Mon, 21 Jun 2021 11:39:36 +0200
Organization: Also freenews.netfront.net; news.tornevall.net;
news.eternal-september.org
Lines: 14
Message-ID: <sapmoo$1q8$1@dont-email.me>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<sao0v5$fej$1@dont-email.me> <sao2fn$fpp$1@gioia.aioe.org>
<saogms$qdj$1@dont-email.me>
<36e54933-06e2-4087-a4d8-77653a4e6a5bn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 21 Jun 2021 09:39:36 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="5d6af5b2024c48caeab8e64f2098b02a";
logging-data="1864"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DcQ79LhmhfK1NHZR4xsm/R+/wJIu70JE="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
Cancel-Lock: sha1:1mhsMxPIAqOZxRTDCwArrLnv4d0=
In-Reply-To: <36e54933-06e2-4087-a4d8-77653a4e6a5bn@googlegroups.com>
Content-Language: en-US
 by: Jeffrey R. Carter - Mon, 21 Jun 2021 09:39 UTC

On 6/21/21 6:16 AM, Marius Amado-Alves wrote:
>> No one has ever spoken Unicode.
>
> Tell that to the billions of speakers using the thousands of languages written in the hundreds of Unicode scripts.

None of whom has ever spoken Unicode.

--
Jeff Carter
"[I]f we should ever separate, my little plum,
I want to give you one little bit of fatherly advice. ... Never
give a sucker an even break."
Poppy
97

Re: XMLAda & unicode symbols

<lybl7zgrxy.fsf@pushface.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5450&group=comp.lang.ada#5450

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!yy9MKEJN2ULhWGfnfq4v5w.user.gioia.aioe.org.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Mon, 21 Jun 2021 16:26:01 +0100
Organization: Aioe.org NNTP Server
Lines: 58
Message-ID: <lybl7zgrxy.fsf@pushface.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<lyk0mph7j6.fsf@pushface.org>
<b4c0edbd-7567-47cb-ba75-2fa27d75a788n@googlegroups.com>
NNTP-Posting-Host: yy9MKEJN2ULhWGfnfq4v5w.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 (darwin)
Cancel-Lock: sha1:nYKXMhoeMWRg1caXzJmxEvyRwow=
X-Notice: Filtered by postfilter v. 0.9.2
 by: Simon Wright - Mon, 21 Jun 2021 15:26 UTC

"196...@googlemail.com" <1963bib@googlemail.com> writes:

> Asking for the degree sign, was probably a slight mistake. There is
> Degree_Celsius and also Degree_Fahrenheit for those who have not yet
> embraced metric. These are the "correct" symbols.

You might equally have meant angular degrees.

> Both of these exist in Unicode.Names.Letterlike_Symbols, and probably
> elsewhere,but trying to shoehorn these in seems impossible.

A scan through XML/Ada shows that the only uses of Unicode_Char are in
the SAX subset. I don't see any way in the DOM subset of XML/Ada of
using them - someone please prove me wrong!

You could build a Unicode_Char to UTF_8_String converter using
Ada.Strings.UTF_Encoding.Wide_Wide_Strings, ARM 4.11(30)
http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-A-4-11.html#p30

> I just wish XMLAda could just accept whatever we throw at it, and if
> we need to convert it, then let us do so outside of it.

That is *exactly* what you have to do (convert outside, not throw any
old sequence of octets and 32-bit values somehow mashed together at
it). It wants a utf-8-encoded string (though XML/Ada doesn't seem to say
so - RFC 3076 implies it, 7303 (8.1) recommends it).

OK, Text_IO might not prove the point to you, but what about this?

with Ada.Characters.Latin_1;
with DOM.Core.Documents;
with DOM.Core.Elements;
with DOM.Core.Nodes;
with DOM.Core;
with Unicode.CES;
with Unicode.Encodings;

procedure Utf is
Impl : DOM.Core.DOM_Implementation;
Doc : DOM.Core.Document;
Dummy, Element : DOM.Core.Node;
Fifty_Degrees_Latin1 : constant String
:= "50" & Ada.Characters.Latin_1.Degree_Sign;
Fifty_Degrees_UTF8 : constant Unicode.CES.Byte_Sequence
:= Unicode.Encodings.Convert
(Fifty_Degrees_Latin1,
From => Unicode.Encodings.Get_By_Name ("iso-8859-15"),
To => Unicode.Encodings.Get_By_Name ("utf-8"));
begin
Doc := DOM.Core.Create_Document (Impl);

Element := DOM.Core.Documents.Create_Element (Doc, "utf");
DOM.Core.Elements.Set_Attribute (Element, "temp", Fifty_Degrees_UTF8);
Dummy := DOM.Core.Nodes.Append_Child (Doc, Element);

DOM.Core.Nodes.Print (Doc);
end Utf;

Re: XMLAda & unicode symbols

<ly7dingrf5.fsf@pushface.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5451&group=comp.lang.ada#5451

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!yy9MKEJN2ULhWGfnfq4v5w.user.gioia.aioe.org.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Mon, 21 Jun 2021 16:37:18 +0100
Organization: Aioe.org NNTP Server
Lines: 8
Message-ID: <ly7dingrf5.fsf@pushface.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<santij$akg$1@gioia.aioe.org>
<874bd6ad-df44-4d63-bb6c-9d2941781e6en@googlegroups.com>
NNTP-Posting-Host: yy9MKEJN2ULhWGfnfq4v5w.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 (darwin)
Cancel-Lock: sha1:EM0bdyRv+o5BUXU5+jLBndIDAiU=
X-Notice: Filtered by postfilter v. 0.9.2
 by: Simon Wright - Mon, 21 Jun 2021 15:37 UTC

"196...@googlemail.com" <1963bib@googlemail.com> writes:

> That's the degree symbol, what I really need is the degree centigrade
> symbol which is U+2103.
>
> Having Character'Val (16#21#) & Character'Val (16#03#) fails at runtime.

That's because the utf-8 encoding is 3 octets, 0xE2 0x84 0x83

Re: XMLAda & unicode symbols

<8d443406-48dc-4d4e-868c-832caabebd1en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5452&group=comp.lang.ada#5452

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:59c7:: with SMTP id n190mr11386qkb.146.1624300437900;
Mon, 21 Jun 2021 11:33:57 -0700 (PDT)
X-Received: by 2002:a25:2405:: with SMTP id k5mr1724858ybk.405.1624300437626;
Mon, 21 Jun 2021 11:33:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 21 Jun 2021 11:33:57 -0700 (PDT)
In-Reply-To: <lybl7zgrxy.fsf@pushface.org>
Injection-Info: google-groups.googlegroups.com; posting-host=87.88.29.208; posting-account=6yLzewoAAABoisbSsCJH1SPMc9UrfXBH
NNTP-Posting-Host: 87.88.29.208
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<lyk0mph7j6.fsf@pushface.org> <b4c0edbd-7567-47cb-ba75-2fa27d75a788n@googlegroups.com>
<lybl7zgrxy.fsf@pushface.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8d443406-48dc-4d4e-868c-832caabebd1en@googlegroups.com>
Subject: Re: XMLAda & unicode symbols
From: briot.em...@gmail.com (Emmanuel Briot)
Injection-Date: Mon, 21 Jun 2021 18:33:57 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Emmanuel Briot - Mon, 21 Jun 2021 18:33 UTC

> A scan through XML/Ada shows that the only uses of Unicode_Char are in
> the SAX subset. I don't see any way in the DOM subset of XML/Ada of
> using them - someone please prove me wrong!

Those two subsets are not independent, in fact the DOM subset is entirely based on the SAX one.
So anything that applies to SAX also applies to DOM.

That said, the DOM standard (at the time I built XML/Ada, which is 20 years ago whereabouts) likely
did not have standard functions that receives unicode characters, only strings.
DOM implementations are free to use any internal representation they want, and I think they did not
have to accept any random encoding. XML/Ada is not user-friendly, it really is only a fairly low-level
implementation of the DOM standard. Using DOM without high-level things like XPath is a real
pain. At the time, someone else had done an XPath implementation, so I never took the time to
duplicate that effort.

Conversion between various encodings (8bit, unicode utf-8, utf-16 or utf-32) is done via the
`unicode` module of XML/Ada, namely for instance `unicode-ces-utf8.ads`. They all provide a similar API. In this case
you want the `Encode` procedure. This is not a function (so doesn't return a Byte_Sequence directly) for efficiency
reason, even if it would be convenient for end-users, admittedly.

As someone rightly mentioned, it doesn't really make sense to use XML/Ada to build a tree in memory just for the
sake of printing it, though. Ada.Text_IO or streams will be much much more efficient. XML/Ada is only useful
to parse XML streams (in which case you never have to yourself encode a character to a byte sequence in
general).

> > we need to convert it, then let us do so outside of it.
> That is *exactly* what you have to do (convert outside, not throw any
> old sequence of octets and 32-bit values somehow mashed together at
> it

Well said Simon, thanks. Basically, the whole application should be utf-8 if you at all care about international
characters (if you don't, feel free to use latin-1, or any encoding your terminal supports). So conversion should not
occur just at the interface to XML/Ada, but only on input and output of your program.
XML/Ada just assumes a string is a sequence of bytes. The actual encoding has to be known by the application,
and be consistent.
If for some reason (Windows ?) you prefer utf-16 internally, you can change `sax-encodings.ads` and recompile.
(would have been neater to use generic traits packages, but I did not realize about them until a few years later).

It would also have been nicer to use a string type that knows about the encoding. I wrote GNATCOLL.Strings for
that purpose several years alter too. XML/Ada was never used extensively, so it was never a priority for AdaCore
to update it to use all these packages, at the risk of either breaking backward compatibility, or duplicating the
whole API to allow for the various string types. Not worth it.

Emmanuel

Re: XMLAda & unicode symbols

<aaf574a5-1340-4d3e-b338-266caefcc3b7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5453&group=comp.lang.ada#5453

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a0c:8563:: with SMTP id n90mr21675008qva.41.1624304456449; Mon, 21 Jun 2021 12:40:56 -0700 (PDT)
X-Received: by 2002:a25:75d6:: with SMTP id q205mr32864767ybc.339.1624304456256; Mon, 21 Jun 2021 12:40:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder5.feed.usenet.farm!feeder1.feed.usenet.farm!feed.usenet.farm!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 21 Jun 2021 12:40:56 -0700 (PDT)
In-Reply-To: <sao0ml$1lm1$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8b0:ca:6:0:0:0:fd; posting-account=TiHetgoAAACluCgYkPc8-TWs6dBNgSne
NNTP-Posting-Host: 2001:8b0:ca:6:0:0:0:fd
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com> <sali0b$hf8$1@dont-email.me> <491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com> <santij$akg$1@gioia.aioe.org> <874bd6ad-df44-4d63-bb6c-9d2941781e6en@googlegroups.com> <sao0ml$1lm1$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <aaf574a5-1340-4d3e-b338-266caefcc3b7n@googlegroups.com>
Subject: Re: XMLAda & unicode symbols
From: 1963...@googlemail.com (196...@googlemail.com)
Injection-Date: Mon, 21 Jun 2021 19:40:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 52
 by: 196...@googlemail.co - Mon, 21 Jun 2021 19:40 UTC

On Sunday, 20 June 2021 at 19:16:57 UTC+1, Dmitry A. Kazakov wrote:
> On 2021-06-20 19:58, 196...@googlemail.com wrote:
> > On Sunday, 20 June 2021 at 18:23:35 UTC+1, Dmitry A. Kazakov wrote:
> >> On 2021-06-20 19:02, 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;
> >>>
> >>> Unfortunately, when XMLAda comes to exporting the DOM tree, it crashed with:
> >>> raised UNICODE.CES.INVALID_ENCODING : unicode-ces-utf8.adb:258
> >> Maybe it expects UTF-8, as most third party Ada libraries do. In that
> >> case use:
> >>
> >> Character'Val (16#C2#) & Character'Val (16#B0#)
> >
> > That's the degree symbol, what I really need is the degree centigrade symbol which is U+2103.
> >
> > Having Character'Val (16#21#) & Character'Val (16#03#) fails at runtime..
> >
> > I'm sure it's easy enough, and when I get it, I'll be banging my head against the desk.
> Why do you use XMLAda? SVG is a text file, I would write directly. It is
> the reverse, rendering SVG image, that is difficult to write from scratch..
>
> And why do you want to create SVG files?
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

I am using XML/Ada as I wish to do it "properly", it's the way you learn.

As for SVG, I am graphing temps, humidity & pressure, and when you zoom in, it still looks sharp. The previous system I coded in C, used png's which were screwed up when Google screwed up and forced HDPI settings on chrome users. THE svg's will also contain code to highlight etc points.

Re: XMLAda & unicode symbols

<a3dc3722-9425-4d57-a1fd-ddee9d0f5f20n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5454&group=comp.lang.ada#5454

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:6a10:: with SMTP id t16mr211040qtr.374.1624304941589; Mon, 21 Jun 2021 12:49:01 -0700 (PDT)
X-Received: by 2002:a25:a365:: with SMTP id d92mr11217957ybi.462.1624304941437; Mon, 21 Jun 2021 12:49:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 21 Jun 2021 12:49:01 -0700 (PDT)
In-Reply-To: <ly7dingrf5.fsf@pushface.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8b0:ca:6:0:0:0:fd; posting-account=TiHetgoAAACluCgYkPc8-TWs6dBNgSne
NNTP-Posting-Host: 2001:8b0:ca:6:0:0:0:fd
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com> <sali0b$hf8$1@dont-email.me> <491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com> <santij$akg$1@gioia.aioe.org> <874bd6ad-df44-4d63-bb6c-9d2941781e6en@googlegroups.com> <ly7dingrf5.fsf@pushface.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a3dc3722-9425-4d57-a1fd-ddee9d0f5f20n@googlegroups.com>
Subject: Re: XMLAda & unicode symbols
From: 1963...@googlemail.com (196...@googlemail.com)
Injection-Date: Mon, 21 Jun 2021 19:49:01 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: 196...@googlemail.co - Mon, 21 Jun 2021 19:49 UTC

On Monday, 21 June 2021 at 16:37:21 UTC+1, Simon Wright wrote:
> "196...@googlemail.com" <196...@googlemail.com> writes:
>
> > That's the degree symbol, what I really need is the degree centigrade
> > symbol which is U+2103.
> >
> > Having Character'Val (16#21#) & Character'Val (16#03#) fails at runtime.
> That's because the utf-8 encoding is 3 octets, 0xE2 0x84 0x83

Yup, that works, but just how the heck do you get from U+2103 to those 3 octets?

I can see from http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=2103&mode=hex that it gives it.

Anyway, the dent in my desk is now a couple of mill deeper.

Thanks

Re: XMLAda & unicode symbols

<7da5a442-2ad9-4bfd-9d6c-c8885da02d05n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5455&group=comp.lang.ada#5455

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:6851:: with SMTP id d78mr365987qkc.483.1624306018422; Mon, 21 Jun 2021 13:06:58 -0700 (PDT)
X-Received: by 2002:a25:e658:: with SMTP id d85mr35818208ybh.165.1624306018288; Mon, 21 Jun 2021 13:06:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 21 Jun 2021 13:06:58 -0700 (PDT)
In-Reply-To: <8d443406-48dc-4d4e-868c-832caabebd1en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8b0:ca:6:0:0:0:fd; posting-account=TiHetgoAAACluCgYkPc8-TWs6dBNgSne
NNTP-Posting-Host: 2001:8b0:ca:6:0:0:0:fd
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com> <lyk0mph7j6.fsf@pushface.org> <b4c0edbd-7567-47cb-ba75-2fa27d75a788n@googlegroups.com> <lybl7zgrxy.fsf@pushface.org> <8d443406-48dc-4d4e-868c-832caabebd1en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7da5a442-2ad9-4bfd-9d6c-c8885da02d05n@googlegroups.com>
Subject: Re: XMLAda & unicode symbols
From: 1963...@googlemail.com (196...@googlemail.com)
Injection-Date: Mon, 21 Jun 2021 20:06:58 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 43
 by: 196...@googlemail.co - Mon, 21 Jun 2021 20:06 UTC

On Monday, 21 June 2021 at 19:33:58 UTC+1, briot.e...@gmail.com wrote:
> > A scan through XML/Ada shows that the only uses of Unicode_Char are in
> > the SAX subset. I don't see any way in the DOM subset of XML/Ada of
> > using them - someone please prove me wrong!
> Those two subsets are not independent, in fact the DOM subset is entirely based on the SAX one.
> So anything that applies to SAX also applies to DOM.
>
> That said, the DOM standard (at the time I built XML/Ada, which is 20 years ago whereabouts) likely
> did not have standard functions that receives unicode characters, only strings.
> DOM implementations are free to use any internal representation they want, and I think they did not
> have to accept any random encoding. XML/Ada is not user-friendly, it really is only a fairly low-level
> implementation of the DOM standard. Using DOM without high-level things like XPath is a real
> pain. At the time, someone else had done an XPath implementation, so I never took the time to
> duplicate that effort.
>
> Conversion between various encodings (8bit, unicode utf-8, utf-16 or utf-32) is done via the
> `unicode` module of XML/Ada, namely for instance `unicode-ces-utf8.ads`. They all provide a similar API. In this case
> you want the `Encode` procedure. This is not a function (so doesn't return a Byte_Sequence directly) for efficiency
> reason, even if it would be convenient for end-users, admittedly.
>
> As someone rightly mentioned, it doesn't really make sense to use XML/Ada to build a tree in memory just for the
> sake of printing it, though. Ada.Text_IO or streams will be much much more efficient. XML/Ada is only useful
> to parse XML streams (in which case you never have to yourself encode a character to a byte sequence in
> general).
> > > we need to convert it, then let us do so outside of it.
> > That is *exactly* what you have to do (convert outside, not throw any
> > old sequence of octets and 32-bit values somehow mashed together at
> > it
> Well said Simon, thanks. Basically, the whole application should be utf-8 if you at all care about international
> characters (if you don't, feel free to use latin-1, or any encoding your terminal supports). So conversion should not
> occur just at the interface to XML/Ada, but only on input and output of your program.
> XML/Ada just assumes a string is a sequence of bytes. The actual encoding has to be known by the application,
> and be consistent.
> If for some reason (Windows ?) you prefer utf-16 internally, you can change `sax-encodings.ads` and recompile.
> (would have been neater to use generic traits packages, but I did not realize about them until a few years later).
>
> It would also have been nicer to use a string type that knows about the encoding. I wrote GNATCOLL.Strings for
> that purpose several years alter too. XML/Ada was never used extensively, so it was never a priority for AdaCore
> to update it to use all these packages, at the risk of either breaking backward compatibility, or duplicating the
> whole API to allow for the various string types. Not worth it.
>
> Emmanuel

Okay, now I think I am getting somewhere. A push and a prod is always welcome.

Re: XMLAda & unicode symbols

<saqs5s$de7$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5456&group=comp.lang.ada#5456

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Mon, 21 Jun 2021 22:18:07 +0200
Organization: Aioe.org NNTP Server
Lines: 23
Message-ID: <saqs5s$de7$1@gioia.aioe.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<santij$akg$1@gioia.aioe.org>
<874bd6ad-df44-4d63-bb6c-9d2941781e6en@googlegroups.com>
<sao0ml$1lm1$1@gioia.aioe.org>
<aaf574a5-1340-4d3e-b338-266caefcc3b7n@googlegroups.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Mon, 21 Jun 2021 20:18 UTC

On 2021-06-21 21:40, 196...@googlemail.com wrote:

> I am using XML/Ada as I wish to do it "properly", it's the way you learn.

It is a huge overhead, and, honestly, there is nothing useful to learn
about XML.

> As for SVG, I am graphing temps, humidity & pressure, and when you zoom in, it still looks sharp.

Why do not you render things directly? Rendering SVG files for the
purpose is like scratch behind the ear with your foot.

> The previous system I coded in C, used png's which were screwed up when Google screwed up and forced HDPI settings on chrome users. THE svg's will also contain code to highlight etc points.

Is it a HTTP server you are doing?

Even more, I would never write any files rather generate page content on
the fly embedding all images.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: XMLAda & unicode symbols

<saqsf9$hjb$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5457&group=comp.lang.ada#5457

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Mon, 21 Jun 2021 22:23:09 +0200
Organization: Aioe.org NNTP Server
Lines: 24
Message-ID: <saqsf9$hjb$1@gioia.aioe.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<santij$akg$1@gioia.aioe.org>
<874bd6ad-df44-4d63-bb6c-9d2941781e6en@googlegroups.com>
<ly7dingrf5.fsf@pushface.org>
<a3dc3722-9425-4d57-a1fd-ddee9d0f5f20n@googlegroups.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Mon, 21 Jun 2021 20:23 UTC

On 2021-06-21 21:49, 196...@googlemail.com wrote:
> On Monday, 21 June 2021 at 16:37:21 UTC+1, Simon Wright wrote:
>> "196...@googlemail.com" <196...@googlemail.com> writes:
>>
>>> That's the degree symbol, what I really need is the degree centigrade
>>> symbol which is U+2103.
>>>
>>> Having Character'Val (16#21#) & Character'Val (16#03#) fails at runtime.
>> That's because the utf-8 encoding is 3 octets, 0xE2 0x84 0x83
>
> Yup, that works, but just how the heck do you get from U+2103 to those 3 octets?

This is how UTF-8 encoding works. It is variable length. Lager the code
point is more octets you need.

https://en.wikipedia.org/wiki/UTF-8

has a nice table explaining how code point bits gets distributed across
the octets.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: XMLAda & unicode symbols

<ly35tbgd2x.fsf@pushface.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5458&group=comp.lang.ada#5458

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!yy9MKEJN2ULhWGfnfq4v5w.user.gioia.aioe.org.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Mon, 21 Jun 2021 21:47:02 +0100
Organization: Aioe.org NNTP Server
Lines: 19
Message-ID: <ly35tbgd2x.fsf@pushface.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<sali0b$hf8$1@dont-email.me>
<491a3435-63c5-464d-83ac-6b82ac39b7d6n@googlegroups.com>
<santij$akg$1@gioia.aioe.org>
<874bd6ad-df44-4d63-bb6c-9d2941781e6en@googlegroups.com>
<ly7dingrf5.fsf@pushface.org>
<a3dc3722-9425-4d57-a1fd-ddee9d0f5f20n@googlegroups.com>
NNTP-Posting-Host: yy9MKEJN2ULhWGfnfq4v5w.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 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:z9a/ksS8FMQ0Iz15r3skjKdfPUw=
 by: Simon Wright - Mon, 21 Jun 2021 20:47 UTC

"196...@googlemail.com" <1963bib@googlemail.com> writes:

> On Monday, 21 June 2021 at 16:37:21 UTC+1, Simon Wright wrote:
>> "196...@googlemail.com" <196...@googlemail.com> writes:
>>
>> > That's the degree symbol, what I really need is the degree centigrade
>> > symbol which is U+2103.
>> >
>> > Having Character'Val (16#21#) & Character'Val (16#03#) fails at runtime.
>> That's because the utf-8 encoding is 3 octets, 0xE2 0x84 0x83
>
> Yup, that works, but just how the heck do you get from U+2103 to those
> 3 octets?
>
> I can see from
> http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=2103&mode=hex that it
> gives it.

Google was my friend (not that site, tho)

Re: XMLAda & unicode symbols

<lypmwegbg1.fsf@pushface.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5459&group=comp.lang.ada#5459

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!yy9MKEJN2ULhWGfnfq4v5w.user.gioia.aioe.org.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: XMLAda & unicode symbols
Date: Mon, 21 Jun 2021 22:22:22 +0100
Organization: Aioe.org NNTP Server
Lines: 19
Message-ID: <lypmwegbg1.fsf@pushface.org>
References: <f9f32d7f-2265-4dd5-8bcb-c477ca449cf3n@googlegroups.com>
<lyk0mph7j6.fsf@pushface.org>
<b4c0edbd-7567-47cb-ba75-2fa27d75a788n@googlegroups.com>
<lybl7zgrxy.fsf@pushface.org>
NNTP-Posting-Host: yy9MKEJN2ULhWGfnfq4v5w.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 (darwin)
Cancel-Lock: sha1:7R9pAZSDv5r3kgJDeZqjiLaREXw=
X-Notice: Filtered by postfilter v. 0.9.2
 by: Simon Wright - Mon, 21 Jun 2021 21:22 UTC

Simon Wright <simon@pushface.org> writes:

> A scan through XML/Ada shows that the only uses of Unicode_Char are in
> the SAX subset. I don't see any way in the DOM subset of XML/Ada of
> using them - someone please prove me wrong!

I missed Unicode itself.

function To_Utf8 (U : Unicode.Unicode_Char)
return Unicode.CES.Byte_Sequence
is
Bytes : Unicode.CES.Byte_Sequence (1 .. 8);
Index : Natural := 0; -- "previously written" position
begin
Unicode.CES.Utf8.Encode (U,
Output => Bytes,
Index => Index);
return Bytes (1 .. Index);
end To_Utf8;

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor