Encoding issue while integrating Moment JS library

与世无争的帅哥 提交于 2019-12-12 11:23:39

问题


I have recently integrated MomentJS library into my application and have been running into a weird issue. Browser I have to use is IE9.

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.

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.


回答1:


For integrating the MomentJS library, instead of

<script src="moment-with-locales.js"></script>

use this

<script src="moment-with-locales.js" charset="UTF-8"></script>



来源:https://stackoverflow.com/questions/26215002/encoding-issue-while-integrating-moment-js-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!