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 arabic characters using mq connection

Post new topic  Reply to topic
 Reading arabic characters using mq connection « View previous topic :: View next topic » 
Author Message
madurairaja
PostPosted: Fri Oct 09, 2015 11:32 am    Post subject: Reading arabic characters using mq connection Reply with quote

Newbie

Joined: 09 Oct 2015
Posts: 3

Dears,
I am reading xml data using MQ connection that contains some arabic characters. But in the log4j log file it shows some junk characters like زÙ?اد سعÙ?د أحÙ. Also the same junk values are used in further usage of same program. Please help to read the proper arabic characters values and to display the same chars in log4j file.

Mq configuration details are,
MQEnvironment.channel=SYSTEM.ADMIN.SVRCONN
MQEnvironment.CCSID=1208

Thanks & Regards,
Raja Mohammed
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Fri Oct 09, 2015 11:40 am    Post subject: Re: Reading arabic characters using mq connection Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

madurairaja wrote:
MQEnvironment.channel=SYSTEM.ADMIN.SVRCONN


You should never use a system channel for any application connection.

madurairaja wrote:
MQEnvironment.CCSID=1208


Does this match the CCSID of the message? Have you coded for any kind of conversion to occur, specifically any conversion from the code page of the message to the code page of the OS where the log4j file is being written and which I'll bet (from personal experience and your posted results) is an ISO-Latin code page that doesn't support Arabic?

Or in summary:

what did you attempt that led you to believe the Arabic characters should be properly handled?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
madurairaja
PostPosted: Fri Oct 09, 2015 12:10 pm    Post subject: Reply with quote

Newbie

Joined: 09 Oct 2015
Posts: 3

Operating System used is AIX, Application server is IBM websphere and Java 7.

Now I tried changing log4j property value to
log4j.appender.mqlogfile.encoding=UTF-8

And after testing I received XML response with Nickname tag value like below
<Nickname>زياد سعيد أحمد خدرج</Nickname><FullName>ziad sayd</FullName>

Both channel & CCSID values are recommended by IBM MQ administrator.
Please suggest if I need to modify anything.
Back to top
View user's profile Send private message Send e-mail
tczielke
PostPosted: Sat Oct 10, 2015 6:16 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

The issue might be with what you are using to view the file.

For example, I am using SecureCRT with a Linux server. The LOCALE is set to en_US.UTF-8, so it does support UTF-8 data.

I have a file that has these 4 Arabic UTF-8 bytes in it in hex:

d8 a1 d8 a2 d8 a3 d8 a4 0a

These are UTF-8 bytes for:
x'd8a1' = Arabic letter hamza
x'd8a2' = Arabic letter alef with madda above
x'd8a3' = Arabic letter alef with hamza above
x'd8a4' = Arabic letter waw with hamza above

However, when I cat this file, I get what looks like garabage data. Checking the Appearance in the Session Options for SecureCRT, I see the Character Encoding is set to Default. When I change it to UTF-8 and then cat the file, now I see the arabic characters.

So that is something to check. Is your shell (i.e. LOCALE) set to support UTF-8? Is your tool for accessing the Unix server (i.e. SecureCRT) set to display the data in UTF-8?

Another option is just to transfer the file to a Windows server and view it in a browser or editor that supports UTF-8. That worked for me, as well.
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
madurairaja
PostPosted: Sun Oct 18, 2015 10:33 am    Post subject: Reply with quote

Newbie

Joined: 09 Oct 2015
Posts: 3

Thank you very much for your useful information. I used code now like strNickName = new String(strNickName.getBytes(),Charset.forName("UTF-8")); It is working fine now.
Back to top
View user's profile Send private message Send e-mail
tczielke
PostPosted: Sun Oct 18, 2015 11:30 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

You are welcome! Glad to hear you got it working.
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Reading arabic characters using mq connection
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.