Loving Coding & Visual Design
PHP出错:json_encode: Invalid UTF-8 sequence in argument
json打包出错:
json_encode(): Invalid UTF-8 sequence in argument
解决办法:检测非法UTF8
mb_check_encoding($strs,'UTF-8')
然后
mb_convert_encoding($strs,'UTF-8','UTF-8');
即可保证不会出现Invalid UTF-8的错误,但是可能结果字符串中会有问号等乱码。
json_encode(): Invalid UTF-8 sequence in argument
解决办法:检测非法UTF8
mb_check_encoding($strs,'UTF-8')
然后
mb_convert_encoding($strs,'UTF-8','UTF-8');
即可保证不会出现Invalid UTF-8的错误,但是可能结果字符串中会有问号等乱码。
最 近 文 章
- 我看react lisence事件 - 2017-09-17T15:45:04.805Z
- FLASH阴谋论 - 2017-08-02T15:15:04.977Z
- Letsencrypt Renew 的坑 - 2017-08-02T15:12:37.509Z
- Hugo serve panic 报错 - 2017-06-22T03:41:30.426Z
- 把reactjs升级到15.5.4 - 2017-05-24T15:04:15.880Z
- 关于SSL证书 - 2017-05-03T16:40:33.137Z
- 关于小朋友和游戏 - 2017-04-09T08:38:25.592Z
- 小程序不全面自由开放只有死路一条 - 2017-03-29T14:49:25.034Z
- Xcode6.3出错NSString is not implicitly convertible to String - Tue, 14 Apr 2015 14:37:47 +0000
- Jquery Ajax Parsererror: Unexpected end of input - Fri, 10 Apr 2015 05:43:22 +0000