摘要: json_encode之后的中文会变成'\u4e2d\n\u8d35'这个样子,提供两个函数转换成中文字符。Python:Python1defunicode_convert(t):2ift:3pattern=re.compile('\\\\u[0-9a-f]{4}')4t_all=pattern.findall(t)56ift_all:7foroint_all:8n=unichr(eval('0x'+o.replace('\\u','')))9t=t.replace(o,n)10returntPHP:PHP1fun 阅读全文
posted @ 2011-11-25 19:20 Jimmy N. L. 阅读(2169) 评论(0) 推荐(0) 编辑