comp.lang.ada
 help / color / mirror / Atom feed
From: Manuel Gomez <mgrojo@gmail.com>
Subject: Re: GtkAda and €
Date: Sat, 11 Sep 2021 19:46:46 +0200	[thread overview]
Message-ID: <shiq27$1ejv$1@gioia.aioe.org> (raw)
In-Reply-To: e8b60ad9-b68f-4520-8f1d-1c8edfa03662n@googlegroups.com

Am 11/9/21 um 15:51 schrieb AdaMagica:
> 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!
> 

When converting to UTF8, can you specify that you are using Latin-9 
(ISO-8859-15), instead of Latin-1? Latin-9 is equivalent to Latin-1 plus 
the Euro sign, instead of the generic currency sign, since Latin-1 
predates the Euro.

In that case, it would be:

    Euro_Sign : constant Character := Character'Val (164);

This is from Ada.Characters.Latin_9, provided by GNAT (not in the 
standard). Not sure, buy maybe you could type the Euro sign in the 
source code with the keyboard, since the representation is the same.

Another option is to use ASCII only (with some encoding for umlauts and 
Euro sign) and then apply localization for the strings that must be 
"translated" to proper German.

  parent reply	other threads:[~2021-09-11 17:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 17:56 GtkAda and € AdaMagica
2021-09-10 18:53 ` Dmitry A. Kazakov
2021-09-11  9:20   ` AdaMagica
2021-09-11  9:57     ` AdaMagica
2021-09-11 10:04     ` Dmitry A. Kazakov
2021-09-11 11:11       ` Emmanuel Briot
2021-09-11 12:47         ` Dmitry A. Kazakov
2021-09-11 13:26       ` AdaMagica
2021-09-11 13:51         ` AdaMagica
2021-09-11 14:13           ` Dmitry A. Kazakov
2021-09-11 17:46           ` Manuel Gomez [this message]
2021-09-12  7:04             ` AdaMagica
2021-09-12 11:44               ` Manuel Gomez
2021-09-13  7:21           ` Vadim Godunko
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox