-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
chunk mode send json #20
Comments
Hi @hyzeer, thanks for reporting this issue - I never tried to send non ASCII chars through JSON, so you're totally right! :) It actually easy to fix by chunk_len = len(s.encode('utf-8'))
await resp.send('{:x}\r\n'.format(chunk_len)) The question here is - do you guys always using |
Hi @belyalov , thanks for your reply. Could you release new firmware after fixed? I can do it, but I not cross compile environment. Thanks! |
Fix just landed and new firmware is ready. Enjoy! |
Thanks! :) |
Hi , thank you very much for your wonderful framework , but I regret to find an error in processing NON-ASCII characters by using the framework .
the above codes in server.py at line 337-340 , "len(chunk)" refer to the numbers of the character variable "chunk" , not the bytes length . It's OK with the return of the function "len( )" , when the character variable is ASCII type , but for the NON-ASCII type , such as a Chinese character , the character number is 1 in function "len( )" , and the length is 3 bytes . So , this function will cause a loss in transmission .
The text was updated successfully, but these errors were encountered: