-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add support for non UTF-8 json input #75
Comments
Hello, according to the json rfc, unicode encoding is enforced. Furthermore, does other json library such as |
@PureWhiteWu sorry for late reply.
Aware your design principle to adhere to JSON std. However, UTF-8 is not the only encoding impl of unicode. Say, if UTF-16 support is on your roadmap, maybe other non unicode encoding support could be simply achieved with little effort I guess. Moreover, JSON std suggests support non UTF-8 encoding as an impl extension. Last words: GBK/GB18030 encoding is much like UTF-8 keeping compatible with ASCII making it easy to support. Thanks |
Thanks, could you give a test case with code? I know |
@liuq19 See this repository for your convenience. |
Thanks, we will investigate it |
Is your feature request related to a problem? Please describe.
sonic-rs would fail if the input bytes contain non UTF-8 characters, even for
pub fn from_slice<'a, T>(json: &'a [u8])
function. However, there exists cases bytes containning non UTF-8 json need serialize/deserialize support, typically encoding GBK/GB18030 in China.Describe the solution you'd like
from_slice
functionfrom_slice
functionDescribe alternatives you've considered
N/A.
Additional context
N/A.
The text was updated successfully, but these errors were encountered: