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 » Having problems when sending message with 'fadas' (accent)

Post new topic  Reply to topic
 Having problems when sending message with 'fadas' (accent) « View previous topic :: View next topic » 
Author Message
javierDiaz
PostPosted: Wed Jul 17, 2002 6:07 am    Post subject: Having problems when sending message with 'fadas' (accent) Reply with quote

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
View user's profile Send private message Visit poster's website
mrlinux
PostPosted: Wed Jul 17, 2002 6:30 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
javierDiaz
PostPosted: Wed Jul 17, 2002 7:38 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mrlinux
PostPosted: Wed Jul 17, 2002 8:21 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
nimconsult
PostPosted: Wed Jul 17, 2002 9:52 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
javierDiaz
PostPosted: Thu Jul 18, 2002 12:44 am    Post subject: accents issue Reply with quote

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
View user's profile Send private message Visit poster's website
mrlinux
PostPosted: Thu Jul 18, 2002 3:17 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
javierDiaz
PostPosted: Tue Jul 23, 2002 2:06 am    Post subject: Problem solved Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Having problems when sending message with 'fadas' (accent)
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.