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 » Reading the chinese characters from the Queue

Post new topic  Reply to topic
 Reading the chinese characters from the Queue « View previous topic :: View next topic » 
Author Message
naresh_mg
PostPosted: Sun Jun 28, 2009 7:38 pm    Post subject: Reading the chinese characters from the Queue Reply with quote

Newbie

Joined: 28 Jun 2009
Posts: 2

Dear,
I am not able to read the Chinese characters from the queue.I have done some character set configuration and all. Please help me for the same.

regards
Naresh Govindaswamy.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Jun 28, 2009 8:26 pm    Post subject: Reply with quote

Grand High Poobah

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

Dear, what have you tried and to what result?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
naresh_mg
PostPosted: Sun Jun 28, 2009 8:45 pm    Post subject: Reply with quote

Newbie

Joined: 28 Jun 2009
Posts: 2

Dear All,

This is what that i have posted to Queue
<?xml version="1.0" encoding="utf-8" ?>
- <BUEBBS>
- <HEADER>
<TAG>0000</TAG>
<CTYCD>CN</CTYCD>
<PSID>DL</PSID>
<SYSCD>EBBSSTS</SYSCD>
<INTFN>PRH</INTFN>
<DATE>090624</DATE>
<TIME>174944</TIME>
<BSDT>090624</BSDT>
</HEADER>
- <DETAIL>
<TAG>1000</TAG>
<BKCD>10310000</BKCD>
<BICCD>10310000414</BICCD>
<BKNM>中国农业银行北京八里桥支行103100004142</BKNM>
<BNKADD>朝阳区京通路双桥段北侧</BNKADD>
<CTYCD>CN</CTYCD>
<CLRCD>AHMD</CLRCD>
<ACTF>D</ACTF>
</DETAIL>
- <DETAIL>
<TAG>1000</TAG>
<BKCD>10310000</BKCD>
<BICCD>10310000416</BICCD>
<BKNM>中国农业银行朝阳支行营业部ceshi103100004167</BKNM>
<BNKADD>朝阳区工体南路东草园1号</BNKADD>
<CTYCD>CN</CTYCD>
<CLRCD>AHMD</CLRCD>
<ACTF>M</ACTF>
</DETAIL>
- <DETAIL>
<TAG>1000</TAG>
<BKCD>10373109</BKCD>
<BICCD>10373109999</BICCD>
<BKNM>中国农业银行云南省分行清算中心103731099997</BKNM>
<BNKADD>昆明市人民中路1 号</BNKADD>
<CTYCD>CN</CTYCD>
<CLRCD>AHMD</CLRCD>
<ACTF>M</ACTF>
</DETAIL>
- <TRAILER>
<HATT>3</HATT>
</TRAILER>
</BUEBBS>

####################

After that This is how i listen the queue.


MQMessage retrievedMessage = new MQMessage();
retrievedMessage.messageId = hello_world.messageId;
MQGetMessageOptions gmo = new MQGetMessageOptions();
system_default_local_queue.get(retrievedMessage, gmo);
retrievedMessage.format=MQC.MQFMT_STRING;
retrievedMessage.characterSet=1200;
String msgText = retrievedMessage.readString(retrievedMessage.getDataLength());


after populating the values form the queue my output XML is like this,

<?xml version="1.0" encoding="utf-8"?><BUEBBS><HEADER><TAG>0000</TAG><CTYCD>CN</CTYCD><PSID>DL</PSID><SYSCD>EBBSSTS</SYSCD><INTFN>PRH</INTFN><DATE>090624</DATE><TIME>174944</TIME><BSDT>090624</BSDT></HEADER><DETAIL><TAG>1000</TAG><BKCD>10310000</BKCD><BICCD>10310000414</BICCD><BKNM>中å?½å??ä¸?é?¶è¡?å??京å?«é??æ¡¥æ?¯è¡?103100004142</BKNM><BNKADD>æ??é?³å?ºäº¬é??è·¯å??桥段å??ä¾§</BNKADD><CTYCD>CN</CTYCD><CLRCD>AHMD</CLRCD><ACTF>D</ACTF></DETAIL><DETAIL><TAG>1000</TAG><BKCD>10310000</BKCD><BICCD>10310000416</BICCD><BKNM>中å?½å??ä¸?é?¶è¡?æ??é?³æ?¯è¡?è?¥ä¸?é?¨ceshi103100004167</BKNM><BNKADD>æ??é?³å?ºå·¥ä½?å??è·¯ä¸?è??å?­1å?·</BNKADD><CTYCD>CN</CTYCD><CLRCD>AHMD</CLRCD><ACTF>M</ACTF></DETAIL><DETAIL><TAG>1000</TAG><BKCD>10373109</BKCD><BICCD>10373109999</BICCD><BKNM>中å?½å??ä¸?é?¶è¡?äº?å??ç??å??è¡?æ¸?ç®?中å¿?103731099997</BKNM><BNKADD>æ??æ??å¸?人æ°?中路1 å?·</BNKADD><CTYCD>CN</CTYCD><CLRCD>AHMD</CLRCD><ACTF>M</ACTF></DETAIL><TRAILER><HATT>3</HATT></TRAILER></BUEBBS>

Please help me out of this.

Regards
Naresh Govindaswamy.
Back to top
View user's profile Send private message
harish_td
PostPosted: Sun Jun 28, 2009 9:50 pm    Post subject: Reply with quote

Master

Joined: 13 Feb 2006
Posts: 236

naresh_mg wrote:
<?xml version="1.0" encoding="utf-8" ?>


What happens when you use 1208 [UTF-8] instead of
naresh_mg wrote:
retrievedMessage.characterSet=1200;


You can read about the different CCSID's here
http://www-01.ibm.com/software/globalization/cdra/appendix_k.jsp

Why not use readUTF and writeUTF methods instead of reading as String?
Back to top
View user's profile Send private message Yahoo Messenger
rekarm01
PostPosted: Mon Jun 29, 2009 2:25 am    Post subject: Re: Reading the chinese characters from the Queue Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

naresh_mg wrote:
This is what that i have posted to Queue

How? Which ccsid does the MQPUT application put in the MQ header?

naresh_mg wrote:
<?xml version="1.0" encoding="utf-8" ?>
...
<BKNM>中国农业银行北京八里桥支行103100004142</BKNM>
...

####################

after populating the values form the queue my output XML is like this,
...
<BKNM>中å?½å??ä¸?é?¶è¡?å??京å?«é??æ¡¥æ?¯è¡?103100004142</BKNM>
...

It looks as if, at some point, the message is encoded using utf-8 (ccsid=1208), but decoded as if it were iso8859-1 (ccsid=819):

Quote:
'中国 ...' --(utf-8)--> X' e4 b8 ad e5 9b bd ...' --(iso8859-1)--> 'ä¸<SHY>­å<CSI>½ ...'

Two possible explanations:
  • the MQPUT application describes the message using the wrong ccsid (should use 1208, not 819)
  • or, the message is correct, but the displaying application is misconfigured (should display as utf-8, not iso8859-1)
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Jun 29, 2009 11:14 am    Post subject: Reply with quote

Grand High Poobah

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

I can think of a third one:
The message is received somewhere on the route with a convert and translated from the original CCSID to 819 loosing thus characters that cannot be represented....
_________________
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 » Reading the chinese characters from the Queue
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.