Author |
Message
|
javierDiaz |
Posted: Wed Jul 17, 2002 6:07 am Post subject: Having problems when sending message with 'fadas' (accent) |
|
|
Novice
Joined: 04 Mar 2002 Posts: 13 Location: Ireland
|
Hi all,
I am sending messages (strings) with characters containing accents or fadas (e.g. á) using the JMS QueueSender send() method to a MQSeries queue. I am printing out the contents of the TextMessage object just before invoking the send method and the fadas appear correctly. However, when I browse the queue they have being replaced with "funny" characters. For example, if the intended message is "Jávier sent this" the message that is actually put onto the queue is "Jávier sent this". Something similar happens with ó,é, ...
Has anyone seen this before? I'd really appreciate your help with this.
Many thanks,
Javier Diaz. |
|
Back to top |
|
 |
mrlinux |
Posted: Wed Jul 17, 2002 6:30 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
How are you browsing the queue ??? MQExplorer ???? also can you look at the hex value of the char and see if it is correct, the program you are using to browse queue may be displaying it differently. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
javierDiaz |
Posted: Wed Jul 17, 2002 7:38 am Post subject: |
|
|
Novice
Joined: 04 Mar 2002 Posts: 13 Location: Ireland
|
Sorry - forgot to say that I used /opt/mqm/samp/bin/amqsbcg <queue_name> <queue_mgr_name> for browsing the queue. All this is running on a UNIX platform.
The following is part of the message being sent via JMS:
00000210: 436F 6E74 6163 745F 4E61 6D65 3D61 6161 'Contact_Name=aaa'
00000220: 4AC3 A176 6965 724A C3A1 7669 6572 3B7D 'JávierJávier;}'
This other bit is what I get when I put "Jávier Jávier" directly onto the queue using amqsput:
00000000: 4AE1 7669 6572 4AE1 7669 6572 'JávierJávier '
As you can see, the hex value for "á" (in bold) is different for these 2 messages. Any ideas?
Cheers,
Javi |
|
Back to top |
|
 |
mrlinux |
Posted: Wed Jul 17, 2002 8:21 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
From the looks of it to me it seems like java is writing a 16bit value for the char instead of 8 bit, what java method are you using to create that portion of the message ???? are you using the UTF version ???? _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
nimconsult |
Posted: Wed Jul 17, 2002 9:52 pm Post subject: |
|
|
 Master
Joined: 22 May 2002 Posts: 268 Location: NIMCONSULT - Belgium
|
This may or may not be a problem.
I understand that the messages are different, but are they in the same character set? If they are not that's no surprise that they have a different content (may be one is UTF-8 and the other is 819 or any other SBCS).
Have you tried to read your first message back in JMS? Does it look right? Maybe the second will also look right (I think that JMS uses MQGMO_CONVERT to retrieve messages but I am not sure. If it does not try a simple base MQGET program -a sample amqget for example- and add the MQGMO_CONVERT option). _________________ Nicolas Maréchal
Senior Architect - Partner
NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be |
|
Back to top |
|
 |
javierDiaz |
Posted: Thu Jul 18, 2002 12:44 am Post subject: accents issue |
|
|
Novice
Joined: 04 Mar 2002 Posts: 13 Location: Ireland
|
Thanks a lot to both of you for your ideas and suggestions. I'll carry out a little research based on your comments and see what happens. I'll let the forum know whatever the outcome.
Cheers,
Javi |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Jul 18, 2002 3:17 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Well the porblem is Java use unicode for it's strings, you have to use utf8 in order to actually get ASCII Character sets. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
javierDiaz |
Posted: Tue Jul 23, 2002 2:06 am Post subject: Problem solved |
|
|
Novice
Joined: 04 Mar 2002 Posts: 13 Location: Ireland
|
Hi there,
Problem solved. You were absolutely right. Our code was relying on Java strings and using a TextMessage object for the outbound message. Replacing it with a BytesMessage object solved the problem immediately.
Thanks a lot for your suggestions. I do really appreciate it.
Javi. |
|
Back to top |
|
 |
|