Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does IOS client code use isoLatin1? #1087

Closed
kkwd opened this issue Sep 13, 2018 · 12 comments
Closed

Why does IOS client code use isoLatin1? #1087

kkwd opened this issue Sep 13, 2018 · 12 comments

Comments

@kkwd
Copy link

kkwd commented Sep 13, 2018

Why does IOS client code use isoLatin1?

@nuclearace
Copy link
Member

What? The client doesn't use isoLatin1, it uses unicode. And the latest version of the client only works with socket.io 2.0, since the way that unicode was encoding changed between 1 and 2.

@kkwd
Copy link
Author

kkwd commented Sep 13, 2018

The ISO terminal is a small end encoding.

@nuclearace
Copy link
Member

Once strings get to you, they should be standard Swift strings, which are fully unicode compatible. What issues are you seeing?

@kkwd
Copy link
Author

kkwd commented Sep 13, 2018

Android and Web Chinese normal, IOS client Chinese garbled, server UTF-8

@nuclearace
Copy link
Member

What server version? The current version of the client only supports socket.io 2.0. If your server is 1.0 you will see garbled unicode, since there was a breaking change between 1 and 2.

@lianxiang1
Copy link

hi I have the same problem @nuclearace
`//NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];

NSData *jsonData = [jsonString dataUsingEncoding:NSISOLatin1StringEncoding];`

When I use NSUTF8StringEncoding to parse callback data ,Chinese is messy code. but ,use NSISOLatin1StringEncoding is right.

@nuclearace
Copy link
Member

@lianxiang1 What server version? See my above post.

@kkwd
Copy link
Author

kkwd commented Sep 13, 2018

Other project versions of server 1.7.16 https://github.com/mrniko/netty-socketio

@nuclearace
Copy link
Member

Looks like that only supports socket.io 1.0, so the current version of the client will not work with it, you'll see your issue. You'll have to use the 1.0 branch. Note that it's no longer supported however.

@nuclearace
Copy link
Member

Looks like there's an issue on that project about it. mrniko/netty-socketio#566

@nuclearace
Copy link
Member

Also just an FYI, this client is only built for the reference implementation of socket.io, which is the node based socket.io. It's up to other vendors to respect the socket.io protocol.

@kkwd
Copy link
Author

kkwd commented Sep 13, 2018

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants