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 » WebSphere Message Broker (ACE) Support » Convert into UTF8

Post new topic  Reply to topic Goto page Previous  1, 2, 3, 4
 Convert into UTF8 « View previous topic :: View next topic » 
Author Message
alethea
PostPosted: Tue Oct 08, 2013 8:50 pm    Post subject: Reply with quote

Apprentice

Joined: 30 Jul 2007
Posts: 45

kimbert wrote:

I would say 'not supplied with the data' rather than 'unknown'.


CCSID is not supplied with data. We want to consider 1208 irrespective of CCISD in which the msg is coming in.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Oct 09, 2013 1:01 am    Post subject: Reply with quote

Grand High Poobah

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

If the CCSID is not supplied with the data, you cannot legitimately parse it correctly. You might be right 95 % of the time but then there will be the odd time or two where the content will not parse.

Setting the outbound CCSID to 1208 ( UTF-8 ) is much easier.
You will have to request from the provider that they provide the correct CCSID for the data.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
joebuckeye
PostPosted: Wed Oct 09, 2013 4:53 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

Looks like someone needs to read this: http://www.joelonsoftware.com/articles/Unicode.html

In case you don't read it all (and you should) this is the most important part

Quote:
If you have a string, in memory, in a file, or in an email message, you have to know what encoding it is in or you cannot interpret it or display it to users correctly.
Back to top
View user's profile Send private message
Nitgeek
PostPosted: Wed Oct 09, 2013 5:38 am    Post subject: Reply with quote

Novice

Joined: 21 Feb 2012
Posts: 21

Not sure what is there in the other posts. Could not read all.

So, I'll just post my answer.

You will have to use java. You can either use java compute node or just call teh external java method from your ESQL code.


Charset.encode is what you need.

Code:
Charset charset = Charset.forName("UTF-8");
String s="your text";
ByteBuffer b=charset.encode(CharBuffer.wrap(s));
String encodedText = new String(b.array());
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Oct 09, 2013 5:49 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Nitgeek wrote:


You will have to use java.


Why?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
dogorsy
PostPosted: Wed Oct 09, 2013 5:56 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

Nitgeek wrote:
Not sure what is there in the other posts. Could not read all.

So, I'll just post my answer.

You will have to use java. You can either use java compute node or just call teh external java method from your ESQL code.


Charset.encode is what you need.

Code:
Charset charset = Charset.forName("UTF-8");
String s="your text";
ByteBuffer b=charset.encode(CharBuffer.wrap(s));
String encodedText = new String(b.array());


Great !!... you don't know what is going on. You could not be bother to read the whole thread, and yet you have an (wrong) opinion...
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Oct 09, 2013 8:08 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

@Nitgeek: I think you are talking nonsense. Please prove me wrong.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3, 4 Page 4 of 4

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Convert into UTF8
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.