最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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>

发布评论

评论列表(0)

  1. 暂无评论