all groups > vj# > june 2004 >
You're in the

vj#

group:

Is it "UTF-8" or "UTF8"?


Is it "UTF-8" or "UTF8"? TheGG
6/20/2004 8:27:02 PM
vj#:
I am porting code from Java to .NET, and one thing that came up was that

String.getBytes( "UTF-8" )

works in Java (JDK 1.4 anyway) but not in J# (throws an unsupported
encoding exception) - however

String.getBytes( "UTF8" )

works in both worlds. I'm more curious than anything else - is this laziness
in the Java implementation, or a minor bug in J# compatibility. Is there a
compile-time constant that I should be using instead of a hardcoded string?

[On a distantly related note: is someone going to answer Martin Friedrich's
post from 4/30/04?]

- G. G.
Re: Is it "UTF-8" or "UTF8"? Bruno Jouhier [MVP]
6/21/2004 3:04:32 PM
I think that this is a JDK 1.1.4 issue: J# is based on JDK 1.1.4 and at the
time, only "UTF8" was accepted. Seems that newer JDKs accept both "UTF8" and
"UTF-8" but J# does not.

Bruno.

"TheGG" <TheGG@discussions.microsoft.com> a écrit dans le message de
news:1DD84826-FBD1-4123-B7EA-EBF04944FDD7@microsoft.com...
[quoted text, click to view]

AddThis Social Bookmark Button