users@jersey.java.net

code for UTF-8 issue

From: geoffrey hendrey <geoff_at_nextdb.net>
Date: Thu, 21 Jan 2010 20:09:59 -0800

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