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
@ProduceMime(text/*;charset={charset})
And
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:
>
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7.1
>
> 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 sun.com>
> CTO Office, Sun Microsystems.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com