One Star

Unicode characters in SOAP/HTTP messages

Hi,
I'm having problems with swedish/special characters in the message body in the tSOAP component. Everything works fine except that the special chars end up as ? in the target system. Tests with other ways of inserting the data points to there not being a problem with the target system.
I've tried adding stuff like new String(_message.getBytes("UTF8"),"UTF8") before sending it out but no luck. Checking the code it seems Talend try to keep stuff UTF8 anyway.
My guess is that the http library in use by Talend have issues with unicode characters. Or at least that's my hunch.
I've attached two network traces from Wireshark and as you can see in the case of the Talend one the characters are displayed strangely but in the case of SoapUI the characters are displayed correctly.
All ideas are welcome.
2 REPLIES
One Star

Re: Unicode characters in SOAP/HTTP messages

For posteritys sake, this is how I ended up solving it. I took the relevant string and just replaced all Scandinavian characters with their HTML counterparts in a tMap. I'm 100% that this will bite me in the ass some day but for the moment it works.
For the moment the code below is not complete, you need to add a ; at the end of every numbercombo. But if I do this here it will only look as the characters are replacing themselves Smiley Happy
out1.input_str.replaceAll("ä","&#228").replaceAll("Ä","&#196")
.replaceAll("ö","&#246").replaceAll("Ö","&#214")
.replaceAll("å","&#229").replaceAll("Å","&#197")
.replaceAll("é","&#233").replaceAll("ü","&#252")
.replaceAll("ø", "&#248").replaceAll("Ø", "&#216")
.replaceAll("æ", "&#230").replaceAll("Æ", "&#198")
One Star

Re: Unicode characters in SOAP/HTTP messages

hey woptsufp,
Any progress with this case yet? I'm facing the same issue I guess..
br,
Matti