admin管理员组

文章数量:1410712

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.

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.

Share Improve this question edited Oct 8, 2014 at 5:42 Chiranjib asked Oct 6, 2014 at 11:11 ChiranjibChiranjib 1,7832 gold badges17 silver badges29 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

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>

本文标签: javascriptEncoding issue while integrating Moment JS libraryStack Overflow