You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Foror <fo...@mail.ru> on 2008/05/01 06:32:07 UTC

Re: Encoding problem (UTF-8)

j> I develop in Ubuntu and changing all to UTF-8 fixed both problems, but on
j> Windows dose not works with the JSONObject. The database is on UTF-8, all
j> data is saved ok, the only problem I get is when returning data on a
j> JSONObject.

Some problem with TextStreamResponse (TAPESTRY-2058). Fix it:

class TextStreamResponse ...

      + private String _charset; // charset get from _contentType(";charset=UTF-8")
                                 // or get from tapestry.response-encoding

public InputStream getStream() throws IOException {
       - return new ByteArrayInputStream(_text.getBytes());
       + return new ByteArrayInputStream(_text.getBytes(_charset));
}

...

return new TextStreamResponse("application/json", jsonObject.toString());


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org