I've been experimenting with posting in Unicode-based XML content (UTF-8 
encoded Chinese characters as it happens) to a JAX-RS resource. The content 
parameter to the resource method is a String and so the content from a post is 
ultimately read in with the 
org.restlet.ext.jaxrs.internal.provider.StringProvider. Unfortunately the 
non-ASCII characters come through garbled.

Digging around the StringProvider class, the problem looks to be with the 
Util.copyToStringBuilder method - it reads in the content a single byte at a 
time but then casts each byte to a char. The implication is that each character 
is one byte which, of course, for UTF-8 encoded characters is incorrect.

The version of Restlet being used is 2.0-RC4. (I've tried including the charset 
HTTP header parameter in the Content-Type header and it makes no difference.)

Am I missing something or is this a bug?

Alistair

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2626010

Reply via email to