ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Corrupted chars

Post new topic  Reply to topic
 Corrupted chars « View previous topic :: View next topic » 
Author Message
fredand44
PostPosted: Tue Oct 31, 2006 7:18 am    Post subject: Corrupted chars Reply with quote

Acolyte

Joined: 14 Feb 2006
Posts: 63

Hello!

We are trying to send a BytesMessage that consists of a XML-string.
In this XML there is som swedish chars for eg ÅÄÖ.

We are sending this JMS-message from a weblogic to MQ and when they arrive at MQ the chars seems to be corrupted.

Do you guys know how to solve this?

I guess we need to set the encoding in some how at the JMS-level.

The XML-string has this encoding but I do not think that matter on the JMS-level:
<?xml version="1.0" encoding="utf-8"?>

We have tried
byteMessage.setStringProperty("Content-Type", "text/xml; charset=utf-8")

But that throws a Exception:

Illegal property name, 'Content-Type'


Any input or ideas would be great!
Best regards

Fredrik
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 31, 2006 7:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

So what you're saying is that you are trying to create a message that contains characters from two different character sets (UTF-8 and "Swedish"), and you want MQ to convert the UTF-8 stuff fine and ignore the Swedish stuff?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Oct 31, 2006 7:54 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Send only UTF-8 data and set the message's CCSID to 1208 (UTF-.
Make sure you define the format as MQSTR.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
fredand44
PostPosted: Tue Oct 31, 2006 11:34 pm    Post subject: Hello! Reply with quote

Acolyte

Joined: 14 Feb 2006
Posts: 63

Hello!

Thanks for your replies!

1) I guess that the chars "ÅÄÖ" in swedish exists in UTF-8. There fore I guess it should be ok to just to create a message with a string with theses chars. But they do not arrive as "ÅÄÖ". Perhaps I ave missed something fundamental?

2) Do you know how to, in JMS, to "Send only UTF-8 data and set the message's CCSID to 1208 (UTF-.
Make sure you define the format as MQSTR. " ... This sound s very interesting. We have tried:
bytesMessage.writeUTF("ÅÄÖ");
...but this is perhaps not enough?

Best regards
Fredrik
Back to top
View user's profile Send private message
fredand44
PostPosted: Tue Oct 31, 2006 11:52 pm    Post subject: Is JMSAdmin the place?? Reply with quote

Acolyte

Joined: 14 Feb 2006
Posts: 63

Hello!

I found this:
http://64.233.183.104/search?q=cache:ib2sHnrMfdcJ:www-306.ibm.com/software/integration/wicserver/library/doc/wics420/wbia_adapters/wscommerce/wscommerce.pdf+%22how+to%22+JMS+CCSID+1208+MQSTR&hl=sv&gl=se&ct=clnk&cd=9

If you search for ccsid then you find:
v alter qcf (JMS_QueueConnection_Factory) ccsid(1208)

To me this looks like I must set this in JMSAdmin.

If that is the place it would be great.

Please stop me if I'm wrong!

Best regards
Fredrik
Back to top
View user's profile Send private message
fredand44
PostPosted: Thu Nov 02, 2006 1:06 am    Post subject: Looks like TextMessage solve this. Reply with quote

Acolyte

Joined: 14 Feb 2006
Posts: 63

Hello!

We tried to send TextMessages instead of BytesMessage and then it looks like the chars is correct.

We tried with the CCSID but that did not seems to do anything.

Best regards
Fredrik
Back to top
View user's profile Send private message
mvic
PostPosted: Thu Nov 02, 2006 2:08 am    Post subject: Re: Looks like TextMessage solve this. Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

fredand44 wrote:
We tried with the CCSID but that did not seems to do anything.

If you want us to comment meaningfully you should consider posting data dumps showing data in/out of your system.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Nov 02, 2006 3:16 am    Post subject: Re: Looks like TextMessage solve this. Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

fredand44 wrote:
Hello!

We tried to send TextMessages instead of BytesMessage and then it looks like the chars is correct.

We tried with the CCSID but that did not seems to do anything.

Best regards
Fredrik

Well that's the way to go. TextMessage will set the format to MQSTR.
Setting the chars in native of the source system, will work.

Now JMS will retrieve the message with the conversion flag. So on the other end you are doing a GET with CONVERT and that will translate the characters if the CCSID is not the same.

A BytesMessage never gets translated from one char set to the other as a byte has the same value whatever the system.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Corrupted chars
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.