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!yy9MKEJN2ULhWGfnfq4v5w.user.gioia.aioe.org.POSTED!not-for-mail From: 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 Message-ID: References: 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 Xref: reader02.eternal-september.org comp.lang.ada:62277 List-Id: Simon Wright 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;