Messages with different Charsets

Jan 11, 2010 at 8:52 AM

hi all

I'm creating a Message with characters incoded with UTF-8. It contains charaters of differnet languages, not only english.

The _message property on the Message object looks OK just before and after send, but on the queue the message is broken.

It does not happen when all characters in the message are plain english ones.

 

I can see that in MsmqQueueNativeMethods.cpp : Java_ionic_Msmq_Queue_nativeSend we're calling jniEnv->GetStringUTFChars(message, 0).

What exactly happen here? May the problem be here?

 

thanks

I.

Coordinator
Jan 11, 2010 at 5:48 PM

It sounds like an encoding problem.

Are you using MsmqJava at both ends?   How do you send and receive the messages?

Coordinator
Mar 28, 2010 at 9:08 PM

Update on this:

I've updated the library to provide more formal support for sending and receiving byte arrays.   This gives you the option:

  • you can do your own encoding - any way you please - at both ends of the wire. 
  • you can ask MsmqJava to do the encoding for you.  It will use UTF-16LE.  (This is compatible with the System.Messaging encoding)

Of course, if you are sending raw data with the v1.2 MsmqJava library, you won't have to worry about string encodings at all.