javascript - Encoding issue while integrating Moment JS library - Stack Overflow

I have recently integrated MomentJS library into my application and have been running into a weird issu

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>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744792656a4594012.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信