集成Moment JS库时编码问题 [英] Encoding issue while integrating Moment JS library
问题描述
我最近将MomentJS库集成到我的应用程序中,并且遇到了一个奇怪的问题。我必须使用的浏览器是IE9。
I have recently integrated MomentJS library into my application and have been running into a weird issue. Browser I have to use is IE9.
当我第一次用zh-cn语言环境启动应用程序时,我看到一些垃圾字符代替日期和时间。当我退出并再次登录时,字符加载正确。
When I launch the application for the first time with zh-cn locale, I see a few junk characters in place of date and time. When I log out and log in again, then the characters load properly.
我检查屏幕上的编码,并且两次都看到它是UTF-8。问题不一致。我不知道应该怎么做才能调试或找到这个问题的根源。关于我应该检查什么的任何指示都将不胜感激。
I check the encoding on screen and see it is UTF-8 both times. The issue is not consistent. I am at a loss as in what should I do to debug or get to the root of this issue. Any pointers about what I should check would be appreciated.
推荐答案
用于集成MomentJS库,而不是
For integrating the MomentJS library, instead of
< script src =moment-with-locales.js>< / script>
使用此
< script src =moment-with-locales.jscharset =UTF- 8>< / script>
这篇关于集成Moment JS库时编码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!