tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Multi byte language problem in request.getParameter()
Date Mon, 22 May 2000 21:36:38 GMT
On Mon, 22 May 2000, Arion wrote:

> Hi!
> Actually, you shouldn't use non-ASCII character in the URL. How knows if
> a lower byte of a character is an empty character? (FYI, empty character
> should be replace by '+' in URL).
> Let's go down to Tomcat, request.getParameter could not get the value
> with correct encoding. You can use String.getBytes and new String to
> convert the character (possibly with POST method)

> "DonS, Choi" wrote:
> > works when
> >
> >
> > But when
> >[
> >
> > a.jsp doesn't work correctly.
> >
> > I'm a korean. And My country use 2-byte lanaguage.

I'm curious -- exactly what error do you see with this?  Arion is
generally correct that you shouldn't enter multi-byte characters directly
into an url -- they need to be url encoded to hexidecimal format as pairs
like: "%C7%D1%B1%DB" (this is the same as the two multi-byte characters
which you included, assuming my display hasn't munged them).

When I tried this on my own system (which is set up w/ Japanese multi-byte
i18n) -- using lynx -- I couldn't generate any incorrect behavior, either
w/ Japanese or w/ the same characters which you included.  I tried sending
them both from the command line (unencoded) and from a form entry box.

I'm not at all sure about the issues with Korean -- it's entirely possible
that you'll need to do something like what Arion describes: getBytes,
followed by creating a string with the appropriate encoding, possibly
after changing the different encoding of the bytes.  I wouldn't be
surprised if encoding issues (mismatch on input/output?) could cause your

Anyway, I'd like to know how and why it's failing ... my experience with
i18n has been surprisingly painless, but clearly that's not always the way
it works out.

thanks --


View raw message