Skip to content
This repository was archived by the owner on Jan 4, 2020. It is now read-only.

Conversation

@Hanqing-Sun
Copy link
Contributor

解决Json中文编码为unicode的问题(mod RestController.class.php)

  • PHP>=5.4, 使用JSON_UNESCAPED_UNICODE
  • 在PHP<=5.3中,先将中文字段urlencodejson_encode后,再用urldecode,也可以保证中文不会被转成unicode

ref: http://www.thinkphp.cn/topic/7857.html

解决Json中文编码为unicode的问题(mod RestController.class.php)
PHP>=5.4, 使用JSON_UNESCAPED_UNICODE
在PHP<=5.3中,先将中文字段urlencode,json_encode后,再用urldecode,也可以保证中文不会被转成unicode

ref:http://www.thinkphp.cn/topic/7857.html
@liu21st liu21st merged commit e27461b into top-think:master Apr 18, 2016
@Hanqing-Sun Hanqing-Sun deleted the patch-1 branch April 19, 2016 02:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants