Hi tom,
tom said:
Read the api doc, the answer is there in plain sight.
If I check the Java 1.5 String API doc I do indeed see that UTF-16
is used.
What if the OP is using Java 1.4 ? (many in the real world are still
stuck with pre-1.5 Java) It certainly isn't "in plain sight" as it
is in 1.5.
What "answer" should he find? UTF-16? I'm 100% sure several
JVM have used UCS-2 internally in the past. And UCS-2 is *not*
identical to UTF-16 (even if they're very similar).
AFAIK Java 1.4 only support all "Unicode 3.0 code units", not all
"Unicode 3.1+ code points". So an 1.4 JVM may very well use
the UCS-2 encoding internally and still be compliant to the
1.4 specs. This is *not* the case for an 1.5 JVM: the (older) UCS-2
encoding isn't sufficient.
In the part you quoted, I see two questions. How's your
post explaining if the OP will have problem or not using that
same encoding? (and what would be that "same" encoding?
UTF-16? UCS-2?)
I find the OP's post to be a legitimate question that deserves
more than a "RTFM". I may have made mistakes in my
explanation, but at least I tried to help him.
And Chris Smith gave a very nice and gentle explanation,
proposing, amongst other, to use UTF-8 (like I did), and
even explaining UTF-8 gotchas (which I wasn't aware of).
Now that may be just me, but I find Chris Smith's answer
to be gentle and insightful, not yours...
Moreover, not so long ago on this group (thanks Google),
you insisted that ASCII was an 8 bit encoding... So if I was
the OP I'd take any advice coming from you regarding
characters set/encoding/etc. with a huge grain of salt for
I wouldn't think you'd be the definitive authority on the
subject.
Good day to you and sorry I feel condescending (but note
that I did find your answer to the OP condescending and
that certainly influenced the tone of my reply here)