Avatar billede fredand Forsker
17. maj 2006 - 21:27 Der er 5 kommentarer og
1 løsning

Corrupted chars/wrong charset?

Hello!

We send a TextMessage from Weblogic 8.1 (over a Messaging bridge in WL) to a Queue at MQ. The messages at the queue is later consumed from a app at WebSphere.

The text is in fact a XML-structure. Unfortunately it may contain swidish signs like "åäö". These chars is corrupted when the message is processed at MQ.

Some where along the way the chars get corrupted. Unfortunately I can not say exactly where the corruption takes place, but I guess it is at MQ.

So now is my question if any one got some hints how to solve this.

Hopefully this is some clues.
The text inside the message is a xml-string. The xml got this encoding:
<?xml version="1.0" encoding="UTF-8"?>
or we have also tried with
<?xml version="1.0" encoding="ISO-8859-1"?>

Acctually we do not think this matters since this is "folded" inside a JMS TextMessage.

We have there for also set this (both utf-8 and iso-8859-1) on the protocol iiop at the server inside WebLogic.

When the message is send we write the xml to file and everything looks fine:

SalesItemLegacyId="ÅÄÖåäöÅÄÖ"

Hopefully you are able to se the chars, in case I have html-encode them like:
&Aring;&Auml;&Ouml;


How ever when the message reach MQ it looks like and we browse the queue the messsage looks like:

001D0  42 75 6E 64 6C 69 6E 67--3D 22 22 20 53 61 6C 65  |Bundling....Sale|
001E0  73 49 74 65 6D 4C 65 67--61 63 79 49 64 3D 22 C3  |sItemLegacyId..+|
001F0  85 C3 84 C3 96 C3 A5 C3--A4 C3 B6 C3 85 C3 84 C3  |.+.+.+.+.+.+.+.+|
00200  96 22 20 53 61 6C 65 73--49 74 65 6D 4E 61 6D 65  |...

And if we browse it with a client tool it looks like:

SalesItemLegacyId="ÅÄÖåäö"

Inside MQ it looks like the "code set"/"page set" is set to 437 or IBM-437 (I hope I put that right since I am at home now).

Our gues is that IBM-437 and UTF-8/ISO-8859-1 give us a missmatch.

So if any one know how to solve this please let us know!

Best regards
Fredrik

Best regards
Fredrik
Avatar billede fredand Forsker
17. maj 2006 - 21:30 #1
Hm strange!
The "SalesItemLegacyId="ÅÄÖåäö"" does not look exact the same on this page, but nearly, like it does in side my client tool for MQ.

/fredrik
Avatar billede arne_v Ekspert
17. maj 2006 - 21:36 #2
det hex dump ligner korrekt UTF-8 encoding af de data

jeg tror at fejlen er at det som henter ud af MQ fejlagtigt fortolker
det som ISO-8859-1

(men naturligvis kunne du lige saa godt aendre det som putter strengen til at
putte i ISO-8859-1)
Avatar billede arne_v Ekspert
17. maj 2006 - 21:36 #3
and sorry about the danish
Avatar billede fredand Forsker
22. maj 2006 - 16:44 #4
Hello!
Thanks for all help, we solved it by using BytesMessage instead.

We do not know why TextMessage or ObjectMessage result in corrupted chars.

Please give a svar so I can reward you mate!

Btw if you got any guess why BytesMessage works feel free to post it in this topic.

Best regards
Fredrik
Avatar billede arne_v Ekspert
22. maj 2006 - 18:53 #5
I think I will pass this one due to no correlation between my comment and your solution
Avatar billede fredand Forsker
16. juni 2006 - 14:16 #6
svar
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester