Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Brain damage is all in your head. -- Karl Lehenbauer


devel / comp.lang.ada / GtkAda and €

SubjectAuthor
* GtkAda and €AdaMagica
`* Re: GtkAda and €Dmitry A. Kazakov
 `* Re: GtkAda and €AdaMagica
  +- Re: GtkAda and €AdaMagica
  `* Re: GtkAda and €Dmitry A. Kazakov
   +* Re: GtkAda and €Emmanuel Briot
   |`- Re: GtkAda and €Dmitry A. Kazakov
   `* Re: GtkAda and €AdaMagica
    `* Re: GtkAda and €AdaMagica
     +- Re: GtkAda and €Dmitry A. Kazakov
     +* Re: GtkAda and €Manuel Gomez
     |`* Re: GtkAda and €AdaMagica
     | `- Re: GtkAda and €Manuel Gomez
     `- Re: GtkAda and €Vadim Godunko

1
GtkAda and €

<06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5868&group=comp.lang.ada#5868

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:c4d:: with SMTP id u13mr8727863qki.411.1631296579637;
Fri, 10 Sep 2021 10:56:19 -0700 (PDT)
X-Received: by 2002:a05:6902:1201:: with SMTP id s1mr12997186ybu.163.1631296579468;
Fri, 10 Sep 2021 10:56:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Fri, 10 Sep 2021 10:56:19 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.123; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.101.123
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
Subject: GtkAda and €
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Fri, 10 Sep 2021 17:56:19 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 1
 by: AdaMagica - Fri, 10 Sep 2021 17:56 UTC

I'm struggling to get the euro sign in a label or on a button in GtkAda.
I have the euro sign on my German keyboard (on the E key), but I have no idea how this is encoded. So how do I get this in UTF8?

Re: GtkAda and €

<shg9ih$htv$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5869&group=comp.lang.ada#5869

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Hx95GBhnJb0Xc8StPhH8AA.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: GtkAda and €
Date: Fri, 10 Sep 2021 20:53:07 +0200
Organization: Aioe.org NNTP Server
Message-ID: <shg9ih$htv$1@gioia.aioe.org>
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="18367"; posting-host="Hx95GBhnJb0Xc8StPhH8AA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Fri, 10 Sep 2021 18:53 UTC

On 2021-09-10 19:56, AdaMagica wrote:
> I'm struggling to get the euro sign in a label or on a button in GtkAda.
> I have the euro sign on my German keyboard (on the E key), but I have no idea how this is encoded. So how do I get this in UTF8?

With Strings Edit:

Strings_Edit.UTF8.Image (16#20A0#)

See:

http://www.dmitry-kazakov.de/ada/strings_edit.htm#7

Otherwise, see:

https://www.fileformat.info/info/unicode/char/20ac/index.htm

It gives the hexadecimal UTF-8 encoding:

0xE2 0x82 0xAC

So, in Ada:

Character'Val (16#E2#) &
Character'Val (16#82#) &
Character'Val (16#AC#)

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

Re: GtkAda and €

<234ee351-3abb-445e-9d34-d5abd7a8a9b6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5877&group=comp.lang.ada#5877

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ad4:5541:: with SMTP id v1mr1278979qvy.49.1631352033044;
Sat, 11 Sep 2021 02:20:33 -0700 (PDT)
X-Received: by 2002:a25:2ccf:: with SMTP id s198mr2465955ybs.452.1631352032740;
Sat, 11 Sep 2021 02:20:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 11 Sep 2021 02:20:32 -0700 (PDT)
In-Reply-To: <shg9ih$htv$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.123; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.101.123
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com> <shg9ih$htv$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <234ee351-3abb-445e-9d34-d5abd7a8a9b6n@googlegroups.com>
Subject: Re: GtkAda and €
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Sat, 11 Sep 2021 09:20:33 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 5
 by: AdaMagica - Sat, 11 Sep 2021 09:20 UTC

Is there no way to use the character € directly? Imagine, you want to write cyrillc on label of a gui? Would you use hex values or would you write
Я говорю по-русски.
Christoph

Re: GtkAda and €

<6026f336-074b-4f9f-b884-c430d5be9050n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5878&group=comp.lang.ada#5878

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:2297:: with SMTP id o23mr1332313qkh.405.1631354271670;
Sat, 11 Sep 2021 02:57:51 -0700 (PDT)
X-Received: by 2002:a25:d497:: with SMTP id m145mr2829433ybf.389.1631354271415;
Sat, 11 Sep 2021 02:57:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 11 Sep 2021 02:57:51 -0700 (PDT)
In-Reply-To: <234ee351-3abb-445e-9d34-d5abd7a8a9b6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.123; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.101.123
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
<shg9ih$htv$1@gioia.aioe.org> <234ee351-3abb-445e-9d34-d5abd7a8a9b6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6026f336-074b-4f9f-b884-c430d5be9050n@googlegroups.com>
Subject: Re: GtkAda and €
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Sat, 11 Sep 2021 09:57:51 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 0
 by: AdaMagica - Sat, 11 Sep 2021 09:57 UTC

Perhaps use it as Wide_Character?

Re: GtkAda and €

<shhuvp$1sik$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5879&group=comp.lang.ada#5879

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Hx95GBhnJb0Xc8StPhH8AA.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: GtkAda and €
Date: Sat, 11 Sep 2021 12:04:40 +0200
Organization: Aioe.org NNTP Server
Message-ID: <shhuvp$1sik$1@gioia.aioe.org>
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
<shg9ih$htv$1@gioia.aioe.org>
<234ee351-3abb-445e-9d34-d5abd7a8a9b6n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="62036"; posting-host="Hx95GBhnJb0Xc8StPhH8AA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Sat, 11 Sep 2021 10:04 UTC

On 2021-09-11 11:20, AdaMagica wrote:
> Is there no way to use the character € directly? Imagine, you want to write cyrillc on label of a gui? Would you use hex values or would you write
> Я говорю по-русски.

I would never use Cyrillic in the source code.

Anyway, this is a question regarding the encoding of literals in Ada.
Ada 2X supports Unicode and GNAT supports Unicode sources.

I never tried it but I suppose the following should work:

Strings_Edit.UTF8.Handling.To_UTF8 ('€');

Here '€' should be resolved to Wide_Character'('€') and then converted
to a UTF-8 encoded String.

As for labels, icons etc, I use GTK style properties.

I.e. let I have a label with a text on it. Usually this label would be
packed in some larger container widget, e.g. Gtk_Grid_Record. I derive a
custom widget from Gtk_Grid_Record. Then I call Initialize_Class_Record
once to create the new widget "type" (used G_New). There I add style
properties like this:

Class_Record : aliased Ada_GObject_Class := Uninitialized_Class;
...

procedure Initialize
( Widget : not null access My_Widget_Record'Class
) is
begin
G_New (Widget, Get_Type); -- Get_Type will register class
...

function Get_Type return GType is
begin
if Initialize_Class_Record
( Ancestor => Gtk.Grid.Get_Type, -- Parent class
Class_Record => Class_Record'Access,
Type_Name => "mywidget"
) then -- Not yet registerd
Install_Style_Property
( GLib.Types.Class_Ref (Class_Record.The_Type),
Gnew_String
( Name => "label",
Nick => "Label",
Blurb => "Label text I want to be able to change",
Default => "I speak English"
) );
...
end if;
return Class_Record.The_Type;
end Get_Type;

The widget must handle "style-updated" from where it would use Style_Get
to get the label text and set it into the label.

So, a Russian localization would be a CSS sheet file defining the
property "label":
---------------------------
mywidget {
-mywidget-label: "Я говорю по-русски";
} ---------------------------

P.S. Inventors of GTK CSS sheets apparently misspelled the word "sheet",
they should have used the letter 'i'! (:-))

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

Re: GtkAda and €

<260f1fa7-95c8-4cbd-b9b8-5ab2b743002cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5880&group=comp.lang.ada#5880

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:650:: with SMTP id a16mr1747551qtb.157.1631358696498;
Sat, 11 Sep 2021 04:11:36 -0700 (PDT)
X-Received: by 2002:a05:6902:124c:: with SMTP id t12mr2978529ybu.91.1631358696041;
Sat, 11 Sep 2021 04:11:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 11 Sep 2021 04:11:35 -0700 (PDT)
In-Reply-To: <shhuvp$1sik$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=87.88.29.208; posting-account=6yLzewoAAABoisbSsCJH1SPMc9UrfXBH
NNTP-Posting-Host: 87.88.29.208
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
<shg9ih$htv$1@gioia.aioe.org> <234ee351-3abb-445e-9d34-d5abd7a8a9b6n@googlegroups.com>
<shhuvp$1sik$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <260f1fa7-95c8-4cbd-b9b8-5ab2b743002cn@googlegroups.com>
Subject: Re: GtkAda and €
From: briot.em...@gmail.com (Emmanuel Briot)
Injection-Date: Sat, 11 Sep 2021 11:11:36 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1926
 by: Emmanuel Briot - Sat, 11 Sep 2021 11:11 UTC

> custom widget from Gtk_Grid_Record. Then I call Initialize_Class_Record
> once to create the new widget "type" (used G_New). There I add style
> properties like this:

I am impressed ! I have never had the courage to actually use those properties in my code...
I would use GtkAda.Intl, so that the code would contain

use GtkAda.Intl;
Button.Set_Label (-"string to translate");

and the translations are given in a separate file.
This is also theoretical for me: although we had initially try to maintain such a translation
file for GPS (and made sure that all user-visible strings on the string where used with the "-"
operator in case we ever wanted to do a translation, it was never done in practice).

Re: GtkAda and €

<shi8hq$1rqd$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5881&group=comp.lang.ada#5881

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Hx95GBhnJb0Xc8StPhH8AA.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: GtkAda and €
Date: Sat, 11 Sep 2021 14:47:53 +0200
Organization: Aioe.org NNTP Server
Message-ID: <shi8hq$1rqd$1@gioia.aioe.org>
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
<shg9ih$htv$1@gioia.aioe.org>
<234ee351-3abb-445e-9d34-d5abd7a8a9b6n@googlegroups.com>
<shhuvp$1sik$1@gioia.aioe.org>
<260f1fa7-95c8-4cbd-b9b8-5ab2b743002cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="61261"; posting-host="Hx95GBhnJb0Xc8StPhH8AA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Sat, 11 Sep 2021 12:47 UTC

On 2021-09-11 13:11, Emmanuel Briot wrote:

> I am impressed ! I have never had the courage to actually use those properties in my code...

I used properties because I had custom general-purpose widgets rather
than an end application like GPS.

A nice thing about GtkAda is that one can use all GTK stuff without any
C insertions and it is highly extensible.

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

Re: GtkAda and €

<4b1683a1-6ad5-4692-b671-807db5b51f27n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5882&group=comp.lang.ada#5882

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:181d:: with SMTP id t29mr2266996qtc.309.1631366790343;
Sat, 11 Sep 2021 06:26:30 -0700 (PDT)
X-Received: by 2002:a05:6902:124c:: with SMTP id t12mr3549359ybu.91.1631366790131;
Sat, 11 Sep 2021 06:26:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 11 Sep 2021 06:26:29 -0700 (PDT)
In-Reply-To: <shhuvp$1sik$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.123; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.101.123
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
<shg9ih$htv$1@gioia.aioe.org> <234ee351-3abb-445e-9d34-d5abd7a8a9b6n@googlegroups.com>
<shhuvp$1sik$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4b1683a1-6ad5-4692-b671-807db5b51f27n@googlegroups.com>
Subject: Re: GtkAda and €
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Sat, 11 Sep 2021 13:26:30 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 28
 by: AdaMagica - Sat, 11 Sep 2021 13:26 UTC

Dmitry A. Kazakov schrieb am Samstag, 11. September 2021 um 12:04:44 UTC+2:
> ...
> Ada 2X supports Unicode and GNAT supports Unicode sources.
>
> I never tried it but I suppose the following should work:
>
> Strings_Edit.UTF8.Handling.To_UTF8 ('€');
>
> Here '€' should be resolved to Wide_Character'('€') and then converted
> to a UTF-8 encoded String.

This does not work. Source files are in Latin_1 per default and € is beyond 255,
so GNAT cannot handle '€'. I tried to set the source file's character set
to Unicode UTF16 (in GPS, from the file's context menu choose "Properties....")
with terrible effects. A real nogo.

> As for labels, icons etc, I use GTK style properties.

I dare not try this...

> P.S. Inventors of GTK CSS sheets apparently misspelled the word "sheet",
> they should have used the letter 'i'! (:-))

Nice

Re: GtkAda and €

<e8b60ad9-b68f-4520-8f1d-1c8edfa03662n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5884&group=comp.lang.ada#5884

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:7b52:: with SMTP id m18mr2391806qtu.128.1631368300829;
Sat, 11 Sep 2021 06:51:40 -0700 (PDT)
X-Received: by 2002:a25:2ccf:: with SMTP id s198mr3537013ybs.452.1631368300698;
Sat, 11 Sep 2021 06:51:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 11 Sep 2021 06:51:40 -0700 (PDT)
In-Reply-To: <4b1683a1-6ad5-4692-b671-807db5b51f27n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.123; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.101.123
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
<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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e8b60ad9-b68f-4520-8f1d-1c8edfa03662n@googlegroups.com>
Subject: Re: GtkAda and €
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Sat, 11 Sep 2021 13:51:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 9
 by: AdaMagica - Sat, 11 Sep 2021 13:51 UTC

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!

Re: GtkAda and €

<shidhk$ak$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5885&group=comp.lang.ada#5885

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Hx95GBhnJb0Xc8StPhH8AA.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: GtkAda and €
Date: Sat, 11 Sep 2021 16:13:07 +0200
Organization: Aioe.org NNTP Server
Message-ID: <shidhk$ak$1@gioia.aioe.org>
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
<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>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="340"; posting-host="Hx95GBhnJb0Xc8StPhH8AA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Sat, 11 Sep 2021 14:13 UTC

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

Re: GtkAda and €

<shiq27$1ejv$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5888&group=comp.lang.ada#5888

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!TFl9E9FPtgqYQS0i9tziBg.user.46.165.242.91.POSTED!not-for-mail
From: mgr...@gmail.com (Manuel Gomez)
Newsgroups: comp.lang.ada
Subject: Re: GtkAda and €
Date: Sat, 11 Sep 2021 19:46:46 +0200
Organization: Aioe.org NNTP Server
Message-ID: <shiq27$1ejv$1@gioia.aioe.org>
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
<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>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="47743"; posting-host="TFl9E9FPtgqYQS0i9tziBg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: Manuel Gomez - Sat, 11 Sep 2021 17:46 UTC

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.

Re: GtkAda and €

<25b8b400-8084-46c3-a1ec-6c721623e111n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5889&group=comp.lang.ada#5889

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a0c:aa01:: with SMTP id d1mr5120201qvb.47.1631430287620;
Sun, 12 Sep 2021 00:04:47 -0700 (PDT)
X-Received: by 2002:a25:4789:: with SMTP id u131mr7579558yba.531.1631430287387;
Sun, 12 Sep 2021 00:04:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 12 Sep 2021 00:04:47 -0700 (PDT)
In-Reply-To: <shiq27$1ejv$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.123; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.101.123
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
<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> <shiq27$1ejv$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <25b8b400-8084-46c3-a1ec-6c721623e111n@googlegroups.com>
Subject: Re: GtkAda and €
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Sun, 12 Sep 2021 07:04:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: AdaMagica - Sun, 12 Sep 2021 07:04 UTC

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.

Re: GtkAda and €

<shkp7m$141$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5892&group=comp.lang.ada#5892

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!TFl9E9FPtgqYQS0i9tziBg.user.46.165.242.91.POSTED!not-for-mail
From: mgr...@gmail.com (Manuel Gomez)
Newsgroups: comp.lang.ada
Subject: Re: GtkAda and €
Date: Sun, 12 Sep 2021 13:44:54 +0200
Organization: Aioe.org NNTP Server
Message-ID: <shkp7m$141$1@gioia.aioe.org>
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com>
<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>
<shiq27$1ejv$1@gioia.aioe.org>
<25b8b400-8084-46c3-a1ec-6c721623e111n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="1153"; posting-host="TFl9E9FPtgqYQS0i9tziBg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: Manuel Gomez - Sun, 12 Sep 2021 11:44 UTC

Am 12/9/21 um 9:04 schrieb AdaMagica:
> 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.

I suppose this is because the conversion assumes Latin-1 input, and it
is acceptable given that String type should be in that encoding, but
with a general string conversion library, like iconv, you can convert
between any 8-bit character encoding and UTF-8.

Here an Ada binding to iconv (I haven't used it):
https://github.com/ytomino/iconv-ada

And Matreshka League has several 8-bit character encodings, although it
lacks ISO-8859-15. It should be easy to add ISO-8859-15 based on ISO-8859-1:
http://forge.ada-ru.org/matreshka/wiki/League/TextCodec

But I guess what you are already doing is the easiest approach. It's
just one character.

Re: GtkAda and €

<9b5142ae-7937-4bc9-9095-7b617cafc5e1n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5897&group=comp.lang.ada#5897

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:5b8d:: with SMTP id a13mr8097005qta.130.1631517665900; Mon, 13 Sep 2021 00:21:05 -0700 (PDT)
X-Received: by 2002:a25:2ccf:: with SMTP id s198mr12847832ybs.452.1631517665704; Mon, 13 Sep 2021 00:21:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 13 Sep 2021 00:21:05 -0700 (PDT)
In-Reply-To: <e8b60ad9-b68f-4520-8f1d-1c8edfa03662n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=87.117.61.165; posting-account=niG3UgoAAAD7iQ3takWjEn_gw6D9X3ww
NNTP-Posting-Host: 87.117.61.165
References: <06dbbe8e-737e-44c2-9e9c-40e8f8aade2fn@googlegroups.com> <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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9b5142ae-7937-4bc9-9095-7b617cafc5e1n@googlegroups.com>
Subject: Re: GtkAda and €
From: vgodu...@gmail.com (Vadim Godunko)
Injection-Date: Mon, 13 Sep 2021 07:21:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 23
 by: Vadim Godunko - Mon, 13 Sep 2021 07:21 UTC

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 :(

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor