It should work, if the Java has UTF-8 support -- and it does have.

Another case might be when the Java VM doesn't have the international
character encoding support. Some time ago I had trouble with it -- so you
must get the "International" version of JDK (I know that Sun's JDK download
page has two choises, one of which is "International version").

But be aware that most Internet browsers do not send the encoding in HTTP
request. So at server side we must guess what encoding do the bytes (in the
request) have. By default Tomcat 3.2 assumes that they are Latin1. So if you
post a request from a page which is in UTF-8 then the browser sends the
request in UTF-8, but because the encoding is missing, then Tomcat converts
bytes to strings using Latin1 encoding. To convert them correctly you cold
use something like: 

String s = new String(
request.getParameter("my_param").getBytes("ISO-8859-1"), "UTF-8");

Also, some browsers might send UTF-8 request bytes in form %XXXX, don't know
how does Tomcat understands that.

Tõnu

> -----Original Message-----
> From: James Radvan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 2001 12:23 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: foriegn characters turn to ? in database
> 
> 
> Out of interest, will using "charset=UTF-8" work? (unicode)
> 
> James
> 
> ---------------------------------
> James Radvan
> Websphere Analyst/Architect
> London, UK
> [EMAIL PROTECTED]
> +44 7990 624899
> 
> 

Reply via email to