2012/5/28 jiangfei <liujiang...@gmail.com>:
JSON 字符串中的 \/ 为合法转义序列,见 json.org 主页上的 JSON 格式的文法定义:
比如 Perl 世界的 JSON::XS 库在就可以正确解码 JSON 字符串中的 \/ 序列。
而你通过 string.gsub(jsonstr,"\\","") 处理过的 JSON 将很可能不再是合法的 JSON 字符串。
Regards,
-agentzh
--
邮件自: 列表“openresty”,专用于技术讨论!
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
详情: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
建议: 提问的智慧 http://wiki.woodpecker.org.cn/moin/AskForHelp
教程: http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html
On Tue, May 29, 2012 at 9:30 PM, Wendal Chen <wenda...@gmail.com> wrote:
> \/ 不是标准的Json转义
>
你的依据是什么呢?
\/ 确实是标准的 JSON 转义序列,可以参见 RFC 4627 中的 2.5. Strings 一节:
http://tools.ietf.org/html/rfc4627
还有 json.org 主页上的 JSON 文法定义也明确规定了 \/ 是合法的字符串转义序列:
Regards,
-agentzh
Regards,
-agentzh
--
邮件自: 列表“openresty”,专用于技术讨论!
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
详情: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
建议: 提问的智慧 http://wiki.woodpecker.org.cn/moin/AskForHelp
教程: http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html