users@jersey.java.net

Re: Change default Xml Encoding

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 10 Apr 2008 15:30:01 +0200

Hi Ben,

For the latest build it is possible specify the character encoding using
the charset parameter of a media type, if the charset parameter is
absent the default is UTF-8.

It is not currently possible to configure a default character encoding
to apply to all text-related media types.

Paul.

Ben wrote:
> Hi Paul,
>
> I am getting again into the server part.. And was wondering if the state is
> still as in feb for creating jaxb responses of a different encoding. I have
> nothing against some plumbing if it's a one time effort, however as it seems
> to me the types produced by the resolver have to be hardcoded
>
> private final Class[] cTypes = {...};
>
> Generating a nasty dependency. Pls correct me if I'm wrong. I imagine a
> different encoding requirement will be especially for all non-english
> locales almost always the case. Is there no plan to make this more easy
> configurable, even at startup?
>
> Thxs ben
>
> -----Original Message-----
> From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
> Sent: Mittwoch, 6. Februar 2008 10:22
> To: users_at_jersey.dev.java.net
> Subject: Re: Change default Xml Encoding
>
>
> Hi Ben,
>
> Ben wrote:
>> Hi there,
>>
>> I wonder what is the easiest way to specify for a Resource that
>> produces
>> "application/xml" a jaxb.encoding of ISO-8859-1 instead of the default
>> UTF-8?
>>
>
> It is not possible to do this in 0.5. But it is possible in 0.6:
>
> https://jersey.dev.java.net/servlets/ReadMsg?list=users&msgNo=598
>
> It seems a little involved but with some helper classes it should take
> the pain away. Maybe the tooling can generated some code for such
> customization.
>
> Paul.
>
>> Rigth now i have more or less just the converters and resources that
>> come with nb6.0 ->generate rs from entity classes.
>>
>>
>>
>> Thanks! Ben
>>
>

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109