Hi Chen,
What looks even odder is that you need to change this property on Response
entities. Is it because you can fix the server-side (cf. you other email)?
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Technical Lead ~ http://www.restlet.org/
http://www.restlet.org
Noelios Technologies ~ http://www.noelios.com/ http://www.noelios.com
De : CB [mailto:chen.be...@gmail.com]
Envoyé : vendredi 16 avril 2010 22:47
À : discuss@restlet.tigris.org
Objet : Re: setting the character set of the returned representation
hi,
indeed strange.
Another option - correct me if I'm wrong is using a
org.restlet.router.Filter:
@Override
protected void afterHandle(Request request, Response response) {
// TODO Auto-generated method stub
super.afterHandle(request, response);
response.getEntity().setCharacterSet(CharacterSet.UTF_8);
}
This way I don't need to override the ServerResource#doHandle for each of my
ServerResources.
Let me know if you think that I'm doing it wrong.
thanks,
Chen.
On Fri, Apr 16, 2010 at 19:59, Thierry Boileau thierry.boil...@noelios.com
wrote:
Hi Chen,
as a quick workaround, you can override the ServerResource#doHandle(Variant)
method:
@Override
protected Representation doHandle(Variant variant) throws ResourceException
{
variant.setCharacterSet(your character set);
return super.doHandle(variant);
}
But that sounds odd...
Best regards,
Thierry Boileau
--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2585
526 dsMessageId=2585526
--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2603359