comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: GtkAda and €
Date: Sun, 12 Sep 2021 00:04:47 -0700 (PDT)	[thread overview]
Message-ID: <25b8b400-8084-46c3-a1ec-6c721623e111n@googlegroups.com> (raw)
In-Reply-To: <shiq27$1ejv$1@gioia.aioe.org>

Manuel Gomez schrieb am Samstag, 11. September 2021 um 19:46:52 UTC+2:
> 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. 

In Gnat Studio, you can set the encoding  (from the file's context menu
choose "Properties...") to Latin_9. Then the character 164 is displayed as €
in the Ada source file. You can even use the € key on the keyboard. That
does not help, however, since Unicode is based on Latin_1, and when this
is transformed to UTF8, the currency character appears on the GtkAda GUI.

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

I indeed use Character 164 as a placeholder in the Ada source code. When
transforming to UTF8, I search for this character first, transform the head
string, insert the Euro sequence and transform the tail string recursively.
This works.

  reply	other threads:[~2021-09-12  7:04 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
2021-09-12  7:04             ` AdaMagica [this message]
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