• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enoding issue of response from a web service for non english characters

 
Rashmi Anand
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am facing an issue in the response recieved from a webservice.
Non english characters like ô ä are coming as ? ? in the xml.

In the schema definition i have this-
"<?xml version='1.0' encoding='ISO-8859-1'?>".
I have changed it encoding to UTF-8 but with no difference.

This issue in particular i am facing in ALSB proxy service.
Did a exhaustive search in the net also.
Highly appreciate any inputs.

Thanks,
Rashmi.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As that XML is served over HTTP the encoding specified in the Content-Type HTTP header is actually more important - it can override the encoding specified in the XML prolog.
See: XML on the Web Has Failed

Rashmi Anand wrote:Non english characters like ô ä are coming as ? ? in the xml.

That may indicate that the real encoding is us-ascii, not UTF-8.
So somewhere your UTF-8 content is being forced into us-ascii encoding so that the non-english characters are replaced with "?".
While us-ascii content can be labeled as UTF-8, us-ascii is not capable of expressing all the characters in UTF-8.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The characters ô and ä have Latin-1 decimal codes of 212 and 196 respectively. You can see it at ISO Latin-1 Character Set. It means that in your case these two characters are most likely encoded as either Latin-1 or UTF-8.

One thing you can try is to catch these characters as you receive them and pass them through a converter.

Please let us know.

Peer, it's disheartening to realize that in the one transmission we can have multiple encoding definitions – HTTP, XML. Does the mime wrapper introduce something as well?

Regards,
Dan
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rashmi,

It would be very nice to capture and see the entire HTTP response message.

To illustrate what Peer said, please have a look at SOAP HTTP Binding. In one example it shows the charset=utf-8 as part of the HTTP header.

Regards,
Dan
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some more examples are at this guide.

For some reason, most of the examples don't use the XML declaration - <?xml version='1.0' encoding='UTF-8'?>

Regards,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic