tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre John Mas <aj...@newtradetech.com>
Subject Re: UTF-8 end to end - what am I doing wrong?
Date Thu, 10 Apr 2003 16:24:51 GMT
Oxley, David wrote:
> I had loads of problems getting UTF-8 to work. The problem you're getting
> sounds like the POST is being read as ISO-8859-1, because the client doesn't
> tell the server (or if it does, it can't be relied upon). Use this in the
> servlet to get the POST.
>     String result = req.getParameter(parm);
>     String value = new String(result.getBytes("ISO-8859-1"), "UTF-8");

I just tried this and it isn't likely to work in my case. Since what I 
am sending is XML passed as the content there are no parameters that can
be found using the above approach. Follows is the sort of message being
sent (header included, and I have reduced the example to the
essentials):


--- EXAMPLE START
POST /myapp/myservlet HTTP/1.1
Content-Length: 1075
Host: localhost
user-agent: experimental
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0" encoding="UTF-8"?>
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP:Header>
   </SOAP:Header>
   <SOAP:Body>
   </SOAP:Body>
</SOAP:Envelope>
--- EXAMPLE END



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message