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

[FEATURE]是否考虑提供汉字转unicode编码的序列化配置? #678

Closed
fanyawei opened this issue Aug 12, 2022 · 2 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@fanyawei
Copy link

请描述您的需求或者改进建议

虽然这几年的浏览器,不需要再将汉字转为unicode编码,但是,在对接其他的语言或其他接口的是候,还是会有这样的需求,建议提供一个序列化的Feature配置,可将汉字转unicode编码

请描述你建议的实现方案

对您想要需求或建议的实现方案的详细描述。

描述您考虑过的替代方案

对您考虑过的任何替代解决方案或功能的描述。

附加信息

如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。

@fanyawei fanyawei added the enhancement New feature or request label Aug 12, 2022
@wenshao wenshao added this to the 2.0.12 milestone Aug 12, 2022
@wenshao
Copy link
Member

wenshao commented Aug 12, 2022

String STR = "中国";
String JSON_STR = "\"\\u4e2d\\u56fd\"";
String json = JSON.toJSONString(STR, JSONWriter.Feature.EscapeNoneAscii);
assertEquals(JSON_STR, json);
assertEquals(STR, JSON.parse(json));

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.12-SNAPSHOT/
已经支持,请帮忙用2.0.12-SNAPSHOT版本验证,2.0.12版本预计在8月21日前发布

@wenshao
Copy link
Member

wenshao commented Aug 20, 2022

https://github.com/alibaba/fastjson2/releases/tag/2.0.12
问题已修复,请用新版本

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

No branches or pull requests

2 participants