#-*- coding=utf-8 -*-
devType = ["公司设备", "个人设备"]
json.dumps( devType[0], ensure_ascii=True, encoding='utf-8' )

注意:这么转换后,如果直接在浏览器中返回json数据,可能还会是

\u516c\u53f8\u8bbe\u5907

但实际用javascript解析json,就发现是中文了

GitHub 加速计划 / js / json
41
5
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:5 个月前 )
3a570393 Bumps [cppcheck](https://github.com/msclock/cppcheck-wheel) from 1.4.8 to 1.5.0. - [Release notes](https://github.com/msclock/cppcheck-wheel/releases) - [Changelog](https://github.com/msclock/cppcheck-wheel/blob/master/.releaserc.js) - [Commits](https://github.com/msclock/cppcheck-wheel/compare/v1.4.8...v1.5.0) --- updated-dependencies: - dependency-name: cppcheck dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 2 天前
4d216e0c Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.1 to 4.6.2. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1...ea165f8d65b6e75b540449e92b4886f43607fa02) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 2 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐