comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Ada & Unicode support
Date: Sun, 21 Sep 2014 02:17:36 +0200
Date: 2014-09-21T02:17:36+02:00	[thread overview]
Message-ID: <871tr5x1wf.fsf@ludovic-brenta.org> (raw)
In-Reply-To: 20140920233647.06c82dde@atmarama.ddns.net

Gour writes on comp.lang.ada:
> So, can someone provide some explanation what is the meaning of e.g.
> full unicode support in 2005 and what is the significance of 'String
> Encoding Package' in this context?

You need to distinguish between the character set and encoding of the
Ada text (which you give to the compiler) and the character set(s) and
encoding(s) that your program must support.

ARM 2.1 specifies that the character set for Ada text is Unicode
(precisely, ISO/IEC 10646:2011 Universal Multiple-Octet Coded Character
Set) and that the encoding is implementation-defined.  For example, GNAT
supports several encodings, including UTF-8 with command-line options.

As for the text that your program must process, that's really up to you.
Ada 95 added the Wide_Character and Wide_String to help you use 16-bit
characters (not exactly UTF-16, rather supporting only the first plane
of the Unicode character set); Ada 2005 added Wide_Wide_Character for
32-bit characters (i.e. UTF-32 encoding) The String Encoding package is
there to help you transcode text between 8-bit Latin_1, UTF-8, proper
UTF-16 and UTF-32.  The new packages are there to help you but they
don't do anything that wasn't possible in previous versions of Ada
(i.e. you could reimplement them in Ada 95 if you so wished).

GTK+ and GtkAda treat all strings as UTF-8.  If your program uses
GtkAda, then don't bother transcoding anything and specify that all
Strings really contain UTF-8.

HTH

-- 
Ludovic Brenta.


  reply	other threads:[~2014-09-21  0:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-20 21:36 Ada & Unicode support Gour
2014-09-21  0:17 ` Ludovic Brenta [this message]
2014-09-21  6:34   ` Gour
2014-09-21  1:07 ` David Botton
2014-09-21  6:40   ` Gour
2014-09-21  7:27   ` Per Sandberg
replies disabled

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