-
Notifications
You must be signed in to change notification settings - Fork 104
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
Python's gb18030 decoder is not the same as w3c's #76
Comments
@HyperHCl , I'm not sure this is the right place to report this decoding issue. |
Well it's nearly clear that Python upstream will not accept this issue: they usually try to support the original national standard, not a w3c/whatwg web-standard. Python's codecs are quite pedantic, cf. ftfy "sloppy" encodings. To Python this problem is just the world doing things The Wrong Way, but to make codecs useful for them people have to make it as wrong as the rest of the world. |
@HyperHCl , I see. But where does this fit w3lib? |
By Googling for "whatwg encoding python" I found an implementation for that standard called webencodings. Implementations for each codec in question:
|
Since this thread is labeled as discussion... I think many Python web applications face this problem. That is, since Pyhton codecs follow ftfy solves part of the problems, But aside from stdlib discussion, What people are thinking and doing? |
https://www.w3.org/TR/encoding/#gb18030-decoder specifies a single-byte special case 0x80 → U+20AC for gbk compatibility, but Python's decoder does not perform this translation.
The text was updated successfully, but these errors were encountered: