Hi there, i solved the problem using the spring encoder that forces it to
UTF-8, and i've put it in the web.xml:
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/rest/*</url-pattern>
</filter-mapping >
seems like its working now :)
thanks for all the help.
On Tue, Jun 14, 2011 at 7:00 PM, Cowtowncoder [via Jersey] <
ml-node+6475255-699545422-73314_at_n2.nabble.com> wrote:
> On Tue, Jun 14, 2011 at 3:23 AM, Maxrunner <[hidden email]<http://user/SendEmail.jtp?type=node&node=6475255&i=0>>
> wrote:
>
> > Yeah, with this resource:
> > @GET
> > @Produces("application/json")
> > @Path("/getOrganica")
> > public Response getOrganica(){
> > System.out.println("super porra utf-8!");
> > Object entity=fillOrganica(123,"Organicão Mind","2010-12-23",true);
> > //return fillOrganica(123,"Organição Mind","2010-12-23",true);
> > return Response.ok(entity).header("charset", "UTF-8").build();
> > }
> >
> > I get this on chrome:
> >
> > {
> > "Organica" : {
> > "designacao" : "Organicão Mind",
>
> It looks like Chrome somehow assumes that encoding of content is
> latin-1; and as such incorrectly decodes byte stream (which is in
> UTF-8) to display two characters, instead of a two-byte Unicode
> character it should display.
>
> Does anyone else know if this is a known Chrome issue? I think it is
> also possible to define encoding with media type used with @Produces;
> something like "application/json; charset=utf-8". Would that help in
> your case?
>
> -+ Tatu +-
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://jersey.576304.n2.nabble.com/how-to-rename-XmlRootElement-in-JSON-tp6173292p6475255.html
> To unsubscribe from how to rename XmlRootElement in JSON, click here<http://jersey.576304.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6173292&code=am9hby5yb3NzYUBnbWFpbC5jb218NjE3MzI5MnwyMDYzODA1MDkw>.
>
>
--
View this message in context: http://jersey.576304.n2.nabble.com/how-to-rename-XmlRootElement-in-JSON-tp6173292p6475421.html
Sent from the Jersey mailing list archive at Nabble.com.