Re: JSR311: Charset defaults

From: Bill Burke <>
Date: Fri, 22 Feb 2008 11:43:41 -0500

Shouldn't we go by what the w3c spec says? i vote for that.

On a side note, do we need language in the spec that the default text
Provider needs to handle



Accept-Charset headers?

Which leads me to another tangent:

MessageWriters need access to the input request.

Marc Hadley wrote:
> Consider the following:
> @GET
> @ProduceMime("text/plain")
> String get() {
> ...
> }
> What charset should we use to serialize the return value ?
> We could assume that the developer intends the charset to be the default
> ISO-8859-1 as specified in:
> In which case we'd emit the content type as-is and just make sure to use
> ISO-8859-1 for serialization.
> Alternatively we could assume that the developer doesn't care what
> charset is used and pick one for them like UTF-8. In that case we'd add
> an explicit charset parameter to the media-type specified in
> @ProduceMime (or via the Response).
> A related question is what to do about other media types like
> application/* where there is no common default. Should we always use
> UTF-8 in that case unless there's an explicit charset parameter specified ?
> Marc.
> ---
> Marc Hadley <marc.hadley at>
> CTO Office, Sun Microsystems.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Bill Burke
JBoss, a division of Red Hat