标签:ons def rip 路径 char details 文件 http png
发现网站上的时间控件乱码了.
查看了下,是使用的第三方控件:My97DatePicker
解决方案第一步:打开浏览器...
搜出来解决方案涉及的2个文件↓
config.js
zh-cn.js
在浏览器上打开对应的js资源路径
http://test.net/Scripts/My97DatePicker/lang/zh-cn.js
果然是乱码.
将该js文件编码类型修改为"UTF-8".
具体步骤↓
将zh-cn.js保存到本地,
用记事本打开zh-cn.js,
选择记事本菜单栏:文件→另存为,
在弹出框的"编码",选择"UTF-8".(我这里的文件以前貌似是"ANSI")
注意事项
{zh-cn.js}文件的编码类型需要和{config.js}中的配置需要匹配?
这点我没有去研究...
如果系统使用UTF-8编码会出现乱码问题。修改如下两个文件可解决:
(1)config.js文件修改成如下内容:
var langList =
[
{name:‘en‘, charset:‘UTF-8‘},
{name:‘zh-cn‘, charset:‘UTF-8‘},
{name:‘zh-tw‘, charset:‘UTF-8‘}
];
var skinList =
[
{name:‘default‘, charset:‘UTF-8‘}
];
(2)zh-cn.js文件修改成如下内容:
var $lang={
errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u8303\u56F4,\u9700\u8981\u64A4\u9500\u5417?",
aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],
aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],
aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"],
aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],
clearStr: "\u6E05\u7A7A",
todayStr: "\u4ECA\u5929",
okStr: "\u786E\u5B9A",
updateStr: "\u786E\u5B9A",
timeStr: "\u65F6\u95F4",
quickStr: "\u5FEB\u901F\u9009\u62E9",
err_1: ‘\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u6700\u5927\u65E5\u671F\!‘
}
标签:ons def rip 路径 char details 文件 http png
原文地址:https://www.cnblogs.com/love-zf/p/12717575.html