You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by David Pascual <dp...@gmail.com> on 2011/01/31 22:20:36 UTC

Apache.NMS.Stomp error receiving special characters

Hi,

We are using NMS STOMP client for CF 2.0, and we have a error when the
client recives text messages with special characters like "é", that are
transformed in illegible characters.

I have modified the BinaryReader constructor from "TcpTransport" class in
NMS Stomp client, just to add Encoding.Default (instead of to use UTF-8,
that is use for default constructor)

socketReader = new BinaryReader(CreateSocketStream(), Encoding.Default);

Wiht this modification, text messages with special characters are received
without errors.

Do we have to do something to send special chareacters in a text message
with Stom? Do you know if we can configure Stomp client to use
Encodig.Default?

Thanks in advance
David

Re: Apache.NMS.Stomp error receiving special characters

Posted by David Pascual <dp...@gmail.com>.
I have created the bug in Jira

https://issues.apache.org/jira/browse/AMQNET-315

Thanks for your help

2011/2/1 Timothy Bish <ta...@gmail.com>

> On Tue, 2011-02-01 at 10:54 +0100, David Pascual wrote:
> > I think text body is encoded  as UTF-8, I have modified the test
> > "TestQueueRollbackConsumerListener" to send the text "Tést Message" and
> when
> > the listener receive the message, the character "é" is illegible. The
> > message is send and recived by Stomp client so the message is processing
> as
> > UTF-8.
> >
> > I have repeated the test reading the message with java client and the
> > special characters are processed without problem, so I think the problem
> is
> > for incoming messages.
> >
> > When a text message is created the only parameter needed is a string and
> in
> > .NET, I think it is encoded as UTF-16. I don't know if this is a problem.
> >
> > Do we have to do something when receive a text message with special
> > characters?
>
> Sounds like a bug, the best thing to do would be to create a new Jira
> issue and attach a unit test that demonstrates the issue.
>
>
> Regards
>
> --
> Tim Bish
> ------------
> FuseSource
> Email: tim.bish@fusesource.com
> Web: http://fusesource.com
> Twitter: tabish121
> Blog: http://timbish.blogspot.com/
>
>
>

Re: Apache.NMS.Stomp error receiving special characters

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2011-02-01 at 10:54 +0100, David Pascual wrote:
> I think text body is encoded  as UTF-8, I have modified the test
> "TestQueueRollbackConsumerListener" to send the text "Tést Message" and when
> the listener receive the message, the character "é" is illegible. The
> message is send and recived by Stomp client so the message is processing as
> UTF-8.
> 
> I have repeated the test reading the message with java client and the
> special characters are processed without problem, so I think the problem is
> for incoming messages.
> 
> When a text message is created the only parameter needed is a string and in
> .NET, I think it is encoded as UTF-16. I don't know if this is a problem.
> 
> Do we have to do something when receive a text message with special
> characters?

Sounds like a bug, the best thing to do would be to create a new Jira
issue and attach a unit test that demonstrates the issue.  


Regards

-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/



Re: Apache.NMS.Stomp error receiving special characters

Posted by David Pascual <dp...@gmail.com>.
I think text body is encoded  as UTF-8, I have modified the test
"TestQueueRollbackConsumerListener" to send the text "Tést Message" and when
the listener receive the message, the character "é" is illegible. The
message is send and recived by Stomp client so the message is processing as
UTF-8.

I have repeated the test reading the message with java client and the
special characters are processed without problem, so I think the problem is
for incoming messages.

When a text message is created the only parameter needed is a string and in
.NET, I think it is encoded as UTF-16. I don't know if this is a problem.

Do we have to do something when receive a text message with special
characters?

2011/1/31 Timothy Bish <ta...@gmail.com>

> On Mon, 2011-01-31 at 22:20 +0100, David Pascual wrote:
> > Hi,
> >
> > We are using NMS STOMP client for CF 2.0, and we have a error when the
> > client recives text messages with special characters like "é", that are
> > transformed in illegible characters.
> >
> > I have modified the BinaryReader constructor from "TcpTransport" class in
> > NMS Stomp client, just to add Encoding.Default (instead of to use UTF-8,
> > that is use for default constructor)
> >
> > socketReader = new BinaryReader(CreateSocketStream(), Encoding.Default);
> >
> > Wiht this modification, text messages with special characters are
> received
> > without errors.
> >
> > Do we have to do something to send special chareacters in a text message
> > with Stom? Do you know if we can configure Stomp client to use
> > Encodig.Default?
> >
> > Thanks in advance
> > David
>
> The Stomp .NET client is expecting that the text in the body of the
> message is encoded as UTF-8.  Is you text being encoded as UTF-8?
>
> Regards
>
> --
> Tim Bish
> ------------
> FuseSource
> Email: tim.bish@fusesource.com
> Web: http://fusesource.com
> Twitter: tabish121
> Blog: http://timbish.blogspot.com/
>
>
>

Re: Apache.NMS.Stomp error receiving special characters

Posted by Timothy Bish <ta...@gmail.com>.
On Mon, 2011-01-31 at 22:20 +0100, David Pascual wrote:
> Hi,
> 
> We are using NMS STOMP client for CF 2.0, and we have a error when the
> client recives text messages with special characters like "é", that are
> transformed in illegible characters.
> 
> I have modified the BinaryReader constructor from "TcpTransport" class in
> NMS Stomp client, just to add Encoding.Default (instead of to use UTF-8,
> that is use for default constructor)
> 
> socketReader = new BinaryReader(CreateSocketStream(), Encoding.Default);
> 
> Wiht this modification, text messages with special characters are received
> without errors.
> 
> Do we have to do something to send special chareacters in a text message
> with Stom? Do you know if we can configure Stomp client to use
> Encodig.Default?
> 
> Thanks in advance
> David

The Stomp .NET client is expecting that the text in the body of the
message is encoded as UTF-8.  Is you text being encoded as UTF-8?

Regards

-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/