On 20/12/06, Kim van der Riet <[EMAIL PROTECTED]> wrote:
On Wed, 2006-12-20 at 15:48 +0000, Martin Ritchie wrote:
> A longstr needs to be capable of handling 2-byte characters while the
> shorstr only deals with ASCII values. I thought String was an ASCII
> string only if that is the case then longstr will need to stay as a
> byte[].
I had thought that String does inherently handle 2-byte characters - it
depends on the codeset/locale used. Fundamentally, String is composed of
2-byte char elements, is it not?

Sorry Kim I was thinking of the encoding on the wire rather than the
other way around.

>From Strings javadoc:
A String represents a string in the UTF-16 format in which supplementary
characters are represented by surrogate pairs (see the section Unicode
Character Representations in the Character class for more information).
Index values refer to char code units, so a supplementary character uses
two positions in a String.

Kim


--
Martin Ritchie

Reply via email to