Javascript编码i18n JSON Accent问题 [英] Javascript encoding i18n JSON Accent issue

查看:97
本文介绍了Javascript编码i18n JSON Accent问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的i18n库存在编码问题.实际上,我无法在JSON文件中使用重音符号,因为它的编码方式不正确. 我已经尝试过

I have an encoding issue with i18n Library. Actually, I can't use accent in my JSON file because it's not well encoded. I've tried

$.ajaxSetup({
    scriptCharset: "utf-8",
    cache: false
});

并添加了

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

在我的标题中,它仍然不起作用. 任何的想法?可能是什么?

in my header and it still doesn't work. Any idea? What it could be?

这是示例页面的链接:

http://m0si.com/lang/index.html?setLng=fr-FR

推荐答案

http://m0si.com/lang/locales/fr-FR/ns.special.json 编码不正确. 尝试将标头强制为utf-8.

The json file in http://m0si.com/lang/locales/fr-FR/ns.special.json is not encoded properly. Try to force headers to utf-8 there.

PS:您的页面上有两次$ .ajaxSetup命令.

PS: You have the $.ajaxSetup command twice on your page.

这篇关于Javascript编码i18n JSON Accent问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆