问题
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