You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Mayank Agarwal <ma...@persistent.co.in> on 2012/10/23 16:07:15 UTC

Problems with UTF-8 encoding.

Hi all,

I am having a problem with UTF-8 encoded characters (for eg: "¥").
When I send it as a message to the queue and then receive it, I get a value that
is not the correct interpretation of that character.
Is there some encoding problem with ActiveMQ or am I missing something?
Should I convert it to some other Character set?

Please help me out.

Regards,
Mayank


Re: Problems with UTF-8 encoding.

Posted by ash <as...@delhaize.be>.
Hi Raul,

Mayank  is not the only one with the problem.

For example I use JMS native client to send a message and then consume it
via the REST API.

I post object messages like so: 
/ObjectMessage message = session.createObjectMessage(new
String(mystring.getBytes("UTF-8")));/
/producer.send(message);/

I do not use textMessages because, when I consume, the REST API removes
"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>" from my XML, so I
post object messages.

If I use curl as follows:
curl -XGET
"http://<myhost>:8161/api/message/<myqueue>?type=queue&oneShot=true" -v -o
output.txt

I get always my charectars (tried: é,è,ç,à,ù) except for the euro sign "€"
which is something I am trying to use. The euro sign appears in hexadicimal!

Thanks in advance.

Kind regards



--
View this message in context: http://activemq.2283324.n4.nabble.com/Problems-with-UTF-8-encoding-tp4658096p4712775.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Problems with UTF-8 encoding.

Posted by Raul Kripalani <ra...@evosent.com>.
If you can post the producer and consumer code, plus the AMQ configuration
(removing any details that cannot go public), we can analyse further.

What message type are you sending? TextMessage? And how are you generating
and reading the String?

Thanks,

*Raúl Kripalani*
Apache Camel Committer
Enterprise Architect, Program Manager, Open Source Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>

On Tue, Oct 23, 2012 at 3:40 PM, Mayank Agarwal <
mayank_agarwal@persistent.co.in> wrote:

> Hello Raul,
> Thanks for the reply.
>
> It is still giving me the same problem. Any other points that I need to
> take
> care of?
>
>
>
>

Re: Problems with UTF-8 encoding.

Posted by Mayank Agarwal <ma...@persistent.co.in>.
Hello Raul,
Thanks for the reply.

It is still giving me the same problem. Any other points that I need to take
care of?




Re: Problems with UTF-8 encoding.

Posted by Raul Kripalani <ra...@evosent.com>.
Make sure you are passing the file.encoding parameter as a JVM option in
the startup script.

-Dfile.encoding="UTF-8"

Sent from a mobile device
On 23 Oct 2012 15:11, "Mayank Agarwal" <ma...@persistent.co.in>
wrote:

> Hi all,
>
> I am having a problem with UTF-8 encoded characters (for eg: "¥").
> When I send it as a message to the queue and then receive it, I get a
> value that
> is not the correct interpretation of that character.
> Is there some encoding problem with ActiveMQ or am I missing something?
> Should I convert it to some other Character set?
>
> Please help me out.
>
> Regards,
> Mayank
>
>