users@jersey.java.net

Re: [Jersey] code for UTF-8 issue

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 25 Jan 2010 10:03:44 +0100

Hi Geoff,

I cannot reproduce using 1.1.5, and i found i fixed the following in
1.1.4:

- Fixed issue 406
   https://jersey.dev.java.net/issues/show_bug.cgi?id=406
   FormDataBodyPart.getValue will honor the charset parameter of the
media
   type associated with the body part.

And by default it will use UTF-8 where as before it would have
utilized the default charset of the platform.

Can you try version 1.1.4 or greater?

Paul.


On Jan 22, 2010, at 5:09 AM, geoffrey hendrey wrote:

> Here is a snippet as a follow-up to my previous posting. If you post
> てすと you will see it printing 9 as the length. I believe 3 to be
> correct. These are valuable links detailing the byte sequence for
> the katakana characters in question:
> http://winrus.com/utf8-jap.htm
> http://winrus.com/codes.htm
>
> @POST
> @Consumes(MediaType.MULTIPART_FORM_DATA)
> public Response postFile(FormDataMultiPart m) {
> System.out.println("This many
> characters:"+m.get("theWord").getValue().toString().length());
> return Response.ok().build();
> }
>
> Jersey version: 'Jersey: 1.1.1-ea 07/14/2009 07:16 PM'
>
> -geoff
>
> --
> http://nextdb.net - RESTful Relational Database
> http://www.nextdb.net/wiki/en/REST