Re: JSR311: Charset defaults

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 03 Mar 2008 10:17:22 -0500

On Feb 22, 2008, at 12:08 PM, Marc Hadley wrote:
>> Shouldn't we go by what the w3c spec says? i vote for that.
> Well, the W3C spec says what the default charset is in a HTTP
> message, it doesn't necessarily cover what the default charset is
> for our @ProduceMime annotation although we could certainly adopt
> that. A problem with using the 8859 charset is that characters in
> the string that aren't part of the 8859 charset can cause problems.
> The Javadoc says the behaviour String.getBytes(charset) is undefined
> if the string contains unsupported characters so you could get a '?'
> in some implementations, or an exception in others. Defaulting to
> UTF-8 would help avoid that.
Any more feedback on this question ? I'm currently thinking that UTF-8
makes the most sense from a Java developers perspective and will adopt
that unless I hear different.


Marc Hadley <marc.hadley at>
CTO Office, Sun Microsystems.