You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ganesh Bms <gb...@gmail.com> on 2015/06/02 14:19:34 UTC

Re: WebSocket: Special character escaping

Thanks Mark. Sample web socket chat helped to identify the problem. In
fact, problem was there in one of third-party lib I used and also, in log4j
config. The log4j was configured with non-utf encoding scheme. That's why
raw web socket messages were getting printed wrongly in log file. I solved
the issue by putting UTF-8 escaping to special characters.

Regards,
Ganesh

On Wed, May 13, 2015 at 4:27 PM, Mark Thomas <ma...@apache.org> wrote:

> On 13/05/2015 11:44, Ganesh Bms wrote:
> > Sorry .. correction to line:
> >
> > The text that my client sends is "Test701á". Server received is
> "SIP701?".
> >
> > Actual: The text that my client sends is "Test701á". Server received is
> > "Test701?".
>
> Lots of places this could go wrong. You need to make sure that
> everything is using UTF-8 everywhere.
>
> I'd check these first:
> - The client is sending the text encoding using UTF-8
> - Your server application is displaying the received String using UTF-8
>
> You can see if Tomcat handles this correctly by using the WebSocket chat
> example and sending special characters.
>
> Mark
>
> >
> > On Wed, May 13, 2015 at 3:33 PM, Ganesh Bms <gb...@gmail.com> wrote:
> >
> >> Hi,
> >>
> >> I have written a web socket server using web socket API(JSR-356) and
> which
> >> runs on tomcat version 7.0.56.
> >> My test client sends some text which has some special characters over
> web
> >> socket connection to my server. the problem is that server is not
> getting
> >> the client's text as it is. the special character got modified to "?".
> >>
> >> The text that my client sends is "Test701á". Server received is
> "SIP701?".
> >> At server, I have just attached Text message handler to web socket
> session.
> >>
> >> This works fine with tomcat version 7.0.55.
> >>
> >> Please let me know if i am missing something here.
> >>
> >> Thank you,
> >> ganesh
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>