comp.lang.ada
 help / color / mirror / Atom feed
From: Vadim Godunko <vgodunko@gmail.com>
Subject: Re: GtkAda and €
Date: Mon, 13 Sep 2021 00:21:05 -0700 (PDT)	[thread overview]
Message-ID: <9b5142ae-7937-4bc9-9095-7b617cafc5e1n@googlegroups.com> (raw)
In-Reply-To: <e8b60ad9-b68f-4520-8f1d-1c8edfa03662n@googlegroups.com>

On Saturday, September 11, 2021 at 4:51:41 PM UTC+3, 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!

Character encoding in source code, input-output and GUI is know mess. There is Ada 2022 library that provides high level API to process text information, see

https://github.com/AdaCore/VSS

You can try to use Virtual_String everywhere, and do encoding conversion only to get/pass text from/to Gtk+ or input-output streams.

Note, if you want to write characters outside of the ASCII range in the source code you will need to use UTF8 for source files and provide -gnatW8 switch to compiler. It may breaks compilation of the old code sometimes :(

      parent reply	other threads:[~2021-09-13  7:21 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
2021-09-12 11:44               ` Manuel Gomez
2021-09-13  7:21           ` Vadim Godunko [this message]
replies disabled

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