[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ada's Wide_Character type



Ada has got a built in type Wide_Character œòÙ¼whose values correspond
to the 65536 code positions of the ISO 10646 Basic Multilingual Plane
(BMP)œòÙ½ (see ARM 3.5.2(3)).  I'd like to write an application (and
a library) which has to handle quite a few different charsets and
I'm considering to use Unicode (or the UCS2 subset) for the internal
representation of characters.  I'm not sure whether I should use the
predefined type Wide_Character or a custom type which can hold any UCS4
character, especially since wchar_t of GNU libc uses UCS4.

Of course, the answer might depend on the languages that will be encoded,
but at least for the library part, this is very hard to predict.
So it's probably best to go for the most general solution, although
this means a bit of additional work in the beginning.  (It seems I can
reuse a lot of the Wide_Character GNAT code, though.)

On the other hand, Ada is not C ;), and it's not that difficult to use a
custom character type later, once you have written a proper imitation of
the standard library subprograms which work on characters and strings.
Thus it's probably okay to use Wide_Character for a start.

-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/