I have encountered an issue whereby HTTP POST form parameters submitted to
a jax-rs based resource
are not being properly decoded using UTF-8, therefore double-byte
characters are being destroyed. The
following discussion from early Restlet 2.0 describes a similar issue:
http://restlet
.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2656816

The issue is that the code path now seems to be slightly different for a
method like the following:

@POST
@Produces("application/json")
public Object dosomething(@FormParam("par") String param) {}

Stepping through the Restlet source, I can track the issue to the following
method that is reading the
stream using single characters:

FormReader.readNextParameter

Not sure when/how the path changed, but this is a pretty serious issue as
it means that any double-
byte chars that are submitted via a Jax-RS endpoint become garbled.

Does anyone have a workaround or fix they can share? I opened a bug on
this, but it seems to have gone unnoticed.
-- 
Nicholas Bonatsakis
Software Engineer
about.me <http://about.me/nickbona>

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

Reply via email to