Thanks!

Since we're using guice-servlets that is a rather easy and elegant solution.

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 14-12-2012 12:57, schreef Martijn Dashorst:
Use a servlet filter?

Martijn

On Fri, Dec 14, 2012 at 12:49 PM, Bas Gooren <b...@iswd.nl> wrote:
Hi *,

We're integrating with a third party. They call a rest endpoint which we
handle through wicket (a special page subclass).

We run a full utf-8 stack, and during integration testing we encountered a
weird problem.
One of the post parameters (a bit of text) is showing the Unicode
replacement character (U+FFFD), shown as
"h�ngt p� d�" (when the actual content is "hängt på dörr").

After a bit of digging I found out that they send an
application/x-www-form-urlencoded body without a charset specified. Tomcat
thus parses it using the default setting (utf-8).

So my problem is this: I get iso-8859-1 content, which is parsed as utf-8,
which does not work.

Is there a way to make wicket interpret this one request as iso-8859-1?
I've taken a look at HttpServletRequest#setCharacterEncoding(), but calling
that from within our endpoint (= wicket page) is too late.
Wicket has already called ServletWebRequest#isAjax(), and thus post
parameters have already been parsed.

Unfortunately, I cannot re-interpret the string as latin1, as I don't have
access to the original byte[] data.

FYI: Wicket 1.5

--

Met vriendelijke groet,
Kind regards,

Bas Gooren




Reply via email to