![]() |
1
1
确保设置
|
![]() |
2
2
我以前也遇到过类似的问题,对我来说,问题在于从API返回的数据的编码是Unicode。我猜,当你复制/粘贴字符串时,你的硬代码最终会变成一种不同的编码,所以当传递到JSON解码时,它会很好地工作。 php文档指定json_decode仅适用于utf-8编码字符串: http://php.net/manual/en/function.json-decode.php 您可以使用mb_convert_encoding()将其转换为utf-8: http://php.net/manual/en/function.mb-convert-encoding.php 在调用json_decode之前尝试此操作:
|
![]() |
3
1
如@eilert hjelmeseth所说,您的json字符串中有一些特殊字符=>“se_±ora” 将字符串编码为utf8的另一种方法: utf8_encode() :
|
![]() |
lonix · 使用sed从JSON中提取非贪婪正则表达式 1 年前 |
![]() |
Henry · 使用Python将json重新格式化为键值对 2 年前 |
![]() |
eymentakak · json字典类型错误:字符串索引必须是整数 2 年前 |
![]() |
Vodka · 如何将单个json对象转换为json数组? 2 年前 |
![]() |
Alper · 从json转换为数据帧? 2 年前 |