On 08/02/2016 18:41, Jason Ricles wrote:
> I have an application that sends binary websocket messages between a
> class and the web application using a websocket server written in
> java.
> 
> The data being sent from the java class is encoded in a binary buffer
> with the bytes in ISO8859_1. However, when I receive the bytes on the
> websocket server and the web application end they are junk (such as
> -121, -116, etc.) and not encoded the correct way that they need to
> be.

The bytes are transmitted as unsigned on the wire (as required by the
WebSocket spec). Java handles them as signed. You need to convert them.
Something like (untested):

char c = b & 0xFF;

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to