Karlsson Kent - keka <[EMAIL PROTECTED]> writes:
> > to his version of package Standard. You should of course get immediately
> > a CONSTRAINT_ERROR exception if a value > U+FFFF found its way from C
> > code into an Ada program.
>
> Does that also mean that Character'Size can be any size *greater than*
> or equal to 8 too?
If an Ada implementation implements the System Programming Annex,
Character'Size and Wide_Character'Size *have* to be 8 and 16,
respectively. (C.2(2) turns the implementation advice 13.3(54) into a
requirement.)
The Size attribute of a character variable can be different, though
(and there are such Ada implementations). On the other Hand, String
is a packed array type, which means that this isn't relevant in
practice.
> The comment (in http://www.adahome.com/rm95/rm9x-A-01.html), that
> "The first 256 positions have the same contents as type Character."
> seems to imply that Character and Wide_character have the same storage
> widths. So *both* Character (with a value limitation to 255) and
> Wide_Character *could* really be, at the storage level, a UCS-2 character,
> a UTF-16 code unit, or UTF-32 character...
No. The reference manual refers to the character names and enumeration
literals in the (pseudo-)definition of Wide_Character. These are
indeed identical in the source representation of the program, but this
doesn't imply that the denoted values are the same! (Enumeration
literals can be overloaded in Ada.)
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/