File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bytes getting misinterpreted..

 
Jayant Raj
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a situation wherin I am firing MQ requests to a backend system to get some data. The data is a string on the backend system 'Credit 1 [1000] '.
The MQ server uses character encoding ISO-8859-1.

However, when this data is read by a Websphere 5 environment, I get 'Credit 1 �1000! ' back.
The same when read by a Websphere 6 environment gives me 'Credit 1 000! '.

How do i resolve this? I have tried setting the 'client.encoding.override' to ISO-8859-1 / UTF-8 in the Websphere server.. But no success!!!
 
Paul Clapham
Sheriff
Pie
Posts: 20166
24
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't a minor difference between ISO-8859-1 and UTF-8; in fact ISO-8859-1 is a subset of UTF-8 in the sense that they both encode characters in the same way if they encode them at all.

The changes to [ and ] suggest to me that there is some kind of EBCDIC-based encoding going on somewhere. Those are basic ASCII characters so the only thing that could change them like that is something completely different from ASCII.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when this data is read by a Websphere 5 environment


Read using what code?

Do you have any way to dump the binary values of the characters in the backend system string?

Bill
 
Jayant Raj
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul & William.. Many thanks for the response.
I have java code deployed in Websphere 5 & 6 servers that fires a MQ message to get the data from the backend. I get a byte[] back & I convert the same to a string & then parse it for information.
Do you reckon it is something to do with the character sets used in the JVM of the servers?
If yes, how do I change the character set used?

Thanks.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a WebSphere question. I'll move this to the WebSphere forum, you might get more responses there.
 
Hanumanth Kanthi
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
**************
'client.encoding.override' to ISO-8859-1 / UTF-8
**************

After setting the above, it should work... I am surprise.....

Did you restarted the server after making above changes to the JVM? If not, pl. do so and see how that affects...

Cheers,
H. Kanthi
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic