users@jersey.java.net

[Jersey] Re: how to rename XmlRootElement in JSON

From: Maxrunner <joao.rossa_at_gmail.com>
Date: Tue, 14 Jun 2011 03:23:11 -0700 (PDT)

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",
    "dataAlteracao" : "2010-12-23",
    "id" : 123,
    "active" : true
  }
}


its the 'ã' character that gets incorrect encoding...


On Mon, Jun 13, 2011 at 7:52 PM, Cowtowncoder [via Jersey] <
ml-node+6471336-1094182429-73314_at_n2.nabble.com> wrote:

> On Mon, Jun 13, 2011 at 6:15 AM, Maxrunner <[hidden email]<http://user/SendEmail.jtp?type=node&node=6471336&i=0>>
> wrote:
> >
> > That's what im doing but i get those wacky chars when i use ç or ã for
> > example....
>
> That means that some piece of code is using incorrect encoding --
> often due to relying on the default platform encoding.
> Another common problem is that System.out does not necessarily use
> encodings correctly; so even if your data is correct, it might look
> like it was not.
>
> -+ 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-tp6173292p6471336.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-tp6173292p6473480.html
Sent from the Jersey mailing list archive at Nabble.com.