WebsocketStompKit icon indicating copy to clipboard operation
WebsocketStompKit copied to clipboard

Can't send accented characters.

Open aaronscherbing opened this issue 9 years ago • 3 comments

I've been using your WebSocketStompKit library. Pretty great! Thanks for making it.

I noticed an issue when trying to send special characters like é. The count is calculated incorrectly, resulting in a failure to send the message.

I think there's a fix on line 372 of WebSocketStompKit.m. You just need to calculate the length using UTF-8.

So the calculation should be: [body lengthOfBytesUsingEncoding:NSUTF8StringEncoding]

in this file:

https://github.com/rguldener/WebsocketStompKit/blob/master/WebsocketStompKit/WebsocketStompKit.m#L372

Thanks again for this library.

aaronscherbing avatar Oct 21 '15 18:10 aaronscherbing

Thanks for the report! Can you test the fix you proposed with your app and open a pull request please?

Thanks!

On 21 Oct 2015, at 20:13, Aaron Scherbing [email protected] wrote:

I've been using your WebSocketStompKit library. Pretty great! Thanks for making it.

I noticed an issue when trying to send special characters like é. The count is calculated incorrectly, resulting in a failure to send the message.

I think there's a fix on line 372 of WebSocketStompKit.m. You just need to calculate the length using UTF-8.

So the calculation should be: [body lengthOfBytesUsingEncoding:NSUTF8StringEncoding]

in this file:

https://github.com/rguldener/WebsocketStompKit/blob/master/WebsocketStompKit/WebsocketStompKit.m#L372

Thanks again for this library.

— Reply to this email directly or view it on GitHub.

rguldener avatar Oct 21 '15 22:10 rguldener

Sure thing. When I get some free time, I'll submit that.

On Wednesday, October 21, 2015, Robin Guldener [email protected] wrote:

Thanks for the report! Can you test the fix you proposed with your app and open a pull request please?

Thanks!

On 21 Oct 2015, at 20:13, Aaron Scherbing <[email protected] javascript:_e(%7B%7D,'cvml','[email protected]');> wrote:

I've been using your WebSocketStompKit library. Pretty great! Thanks for making it.

I noticed an issue when trying to send special characters like é. The count is calculated incorrectly, resulting in a failure to send the message.

I think there's a fix on line 372 of WebSocketStompKit.m. You just need to calculate the length using UTF-8.

So the calculation should be: [body lengthOfBytesUsingEncoding:NSUTF8StringEncoding]

in this file:

https://github.com/rguldener/WebsocketStompKit/blob/master/WebsocketStompKit/WebsocketStompKit.m#L372

Thanks again for this library.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/rguldener/WebsocketStompKit/issues/3#issuecomment-150042104 .

Aaron Scherbing - 952.240.1321

aaronscherbing avatar Oct 22 '15 14:10 aaronscherbing

I had the same problem when trying to send latin characters like Š Č - this fix worked great!

mixdux avatar Dec 18 '15 14:12 mixdux