Groups | Search | Server Info | Login | Register


Groups > comp.lang.ada > #49488

Re: GtkAda and €

From "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Newsgroups comp.lang.ada
Subject Re: GtkAda and €
Date 2021-09-11 16:13 +0200
Organization Aioe.org NNTP Server
Message-ID <shidhk$ak$1@gioia.aioe.org> (permalink)
References (1 earlier) <shg9ih$htv$1@gioia.aioe.org> <234ee351-3abb-445e-9d34-d5abd7a8a9b6n@googlegroups.com> <shhuvp$1sik$1@gioia.aioe.org> <4b1683a1-6ad5-4692-b671-807db5b51f27n@googlegroups.com> <e8b60ad9-b68f-4520-8f1d-1c8edfa03662n@googlegroups.com>

Show all headers | View raw


On 2021-09-11 15:51, AdaMagica wrote:
> Being German, I need umlauts and € together in strings to write them to some labels.
> Using Character'Val (16#E2#) & Character'Val (16#82#) & Character'Val (16#AC#)
> complicates things, since umlauts are above 255 and need transformation to UTF8,
> whereas the euro sequence above is already in UTF8 and must not again be transformed.
> 
> What a mess!

Huh, the mess here is Latin-1 introduced by Ada 95, no such thing should 
have been even supported. This happened because in 90s UTF-8 was not yet 
established, so Ada 95 made Character Latin-1 and added Wide_Character 
for UCS-2. This was a huge mistake with wide (pun intended) reaching 
nasty consequences.

Since Ada type system is too weak to handle encodings, Strings should 
simply be UTF-8 and Character an octet with lower 7-bits corresponding 
to ASCII.

Anyway, for anything that is not ASCII I use a named constant.

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

Back to comp.lang.ada | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

GtkAda and € AdaMagica <christ-usch.grein@t-online.de> - 2021-09-10 10:56 -0700
  Re: GtkAda and € "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-10 20:53 +0200
    Re: GtkAda and € AdaMagica <christ-usch.grein@t-online.de> - 2021-09-11 02:20 -0700
      Re: GtkAda and € AdaMagica <christ-usch.grein@t-online.de> - 2021-09-11 02:57 -0700
      Re: GtkAda and € "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-11 12:04 +0200
        Re: GtkAda and € Emmanuel Briot <briot.emmanuel@gmail.com> - 2021-09-11 04:11 -0700
          Re: GtkAda and € "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-11 14:47 +0200
        Re: GtkAda and € AdaMagica <christ-usch.grein@t-online.de> - 2021-09-11 06:26 -0700
          Re: GtkAda and € AdaMagica <christ-usch.grein@t-online.de> - 2021-09-11 06:51 -0700
            Re: GtkAda and € "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-11 16:13 +0200
            Re: GtkAda and € Manuel Gomez <mgrojo@gmail.com> - 2021-09-11 19:46 +0200
              Re: GtkAda and € AdaMagica <christ-usch.grein@t-online.de> - 2021-09-12 00:04 -0700
                Re: GtkAda and € Manuel Gomez <mgrojo@gmail.com> - 2021-09-12 13:44 +0200
            Re: GtkAda and € Vadim Godunko <vgodunko@gmail.com> - 2021-09-13 00:21 -0700

csiph-web