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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Bug in Ada - Latin 1 is not a subset of UTF-8 Date: Mon, 17 Oct 2016 22:57:33 +0200 Organization: JSA Research & Innovation Message-ID: <87funuae2q.fsf@adaheads.sparre-andersen.dk> References: <86f0d2fe-d498-4bc4-bb9d-e34629c89bb4@googlegroups.com> NNTP-Posting-Host: dynamic-adsl-78-15-241-38.clienti.tiscali.it Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: franka.jacob-sparre.dk 1476737820 8230 78.15.241.38 (17 Oct 2016 20:57:00 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 17 Oct 2016 20:57:00 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:BbtFBAGvUeRPKv7kB+dsHdiLhbk= Xref: news.eternal-september.org comp.lang.ada:32099 Date: 2016-10-17T22:57:33+02:00 List-Id: Lucretia wrote: > Whilst binding SDL_TTF function, I was going to Overload the TTF_Size* > functions, but I couldn't do that because UTF_8_String is a subtype of > String; String is Latin 1 and Latin 1 is not a subset of UTF-8, ASCII > is. > > UTF_String should be implemented as an array like String and then > UTF_8_String should be a subtype of UTF_String or a renaming, if that > is the intent. I think the best you can do is to ignore the subtypes declared in Ada.Strings.UTF_Encoding (as they are just plain wrong), and declare your own type for storing UTF-8 encoded strings. Greetings, Jacob -- "There are only two types of data: Data which has been backed up Data which has not been lost - yet"