tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DonS, Choi" <dsc...@dreami.co.kr>
Subject Re: Multi byte language problem in request.getParameter()
Date Mon, 27 Mar 2000 09:06:15 GMT
I have a following code

-----------------------------------------
..
<script>
function search_winner(name)
{
 location.href= 'e_winner.jsp?sid=' + sid + '&name=' + name;
};
</script>
.....
-----------------------------------------------------------------------
In above sample code "name" is 2-byte lanaguage (non-ASCII)
So tomcat should handle  URL  http://e_winner.jsp?sid=0000&name=나

In weblogic(our company uses weblogic), there is no problem.
Weblogic can handle 2-byte lanuage in URL.

Is there any solution?



----- Original Message ----- 
From: <ed@apache.org>
To: <tomcat-dev@jakarta.apache.org>
Sent: Tuesday, May 23, 2000 6:36 AM
Subject: Re: Multi byte language problem in request.getParameter()


> 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:
> [snip]
> > > works when
> > > http://a.com/a.jsp?name=test
> > >
> > > But when
> > > http://a.com/a.jsp?name=GQ1[
> > >
> > > 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
> problem.
> 
> 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 --
> 
> Ed
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
Mime
View raw message