Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I need clarification on how can I do encoding on my string to meet Decoding in Java for ToBase64 and UTF8 decoding.
I am doing the following logic, but even then the characters are showing junk. I am using this for Japanese characters (Max UTF 8)
byte[] lArrByte = ASCIIEncoding.UTF8.GetBytes(strInputMsg.ToCharArray());
string lSTrBase64String = Convert.ToBase64String(lArrByte);
queueMessage.WriteBytes(lSTrBase64String);
queueMessage.CharacterSet = lSTrBase64String.Length;
queueMessage.Format = MQC.MQFMT_IMS_VAR_STRING;
queuePutMessageOptions = new MQPutMessageOptions();
queue.Put(queueMessage, queuePutMessageOptions);
queueManager.Commit();

Any Suggestions on this please.
Thanks
Sreenath.
Posted
Updated 6-Apr-11 3:12am
v2
Comments
Toniyo Jackson 6-Apr-11 9:12am    
Pre tag added for code
marc11h 1-Nov-11 15:57pm    
Any progress on this? I am undertaking a project that involves foreign text and am having issues.
Kythen 1-Nov-11 17:30pm    
Is there a typo in your code snippet? The line
queueMessage.CharacterSet = lSTrBase64String.Length;
doesn't make much sense at first glance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900