• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Bytes getting misinterpreted..

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Sheriff
Posts: 28399
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like a WebSphere question. I'll move this to the WebSphere forum, you might get more responses there.
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic