Thanks, Anish, for your response. The problem was not the response from the web service. Something must have been completely mixed up. I set the Java option -Dfile.encoding to utf-8 which solved the write to file problem and also put this in the code:

if (req.getCharacterEncoding() == null)
   req.setCharacterEncoding("UTF-8");
res.setContentType("text/html; charset=UTF-8");
res.setCharacterEncoding("UTF-8");

Which solved the encoding of the response I got from the servlet.

Best
Tim

Anish schrieb:
try this....

Options options = stub._getServiceClient().getOptions();

options.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING,"UTF-8");



regards

Anish

----- Original Message ----- From: "Tim-Christian Mundt" <[email protected]>
To: <[email protected]>
Sent: Tuesday, August 24, 2010 3:10 PM
Subject: decoding to UTF-8


Hi,

I'm using axis via the alfresco web services and have the problem that I don't get UTF-8 encoded text back from the service. For instance when I make a call and receive a response which contains "Łódź" I finally get "?ód?" in my Java program (console, file, whatever output). Doing the same with PHP (not axis) works - meaning the web service itself seems to work correctly, the problem is the Java client.

I had a look at the SOAP response with Wireshark and it showed that "Ł", "ó" and "ź" are encoded as "&#<unicodeCodePoint>;" (e.g. &#141; for Ł). Hence, the problem is not the encoding of the response itself but there must be some decoding on the client side which for some reason produces Latin-1 instead of UTF-8.

How can I make axis to give me UTF-8 encoded text?

Thanks
Tim

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to