Encoding issue when integrating Moment JS library

I recently included the MomentJS library in my application and got confused about a strange problem. The browser I have to use is IE9.

When I launch the application for the first time with zh-cn locale, I see some unnecessary characters instead of date and time. When I log out and log back in, the characters load correctly.

I check the encoding on the screen and see UTF-8 both times. The problem is not consistent. I am at a loss as to what I have to do to debug or get the root of this problem. Any pointers to what I should check would be appreciated.

+5
source share
1 answer

To integrate MomentJS library instead

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

use this

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

+7
source

Source: https://habr.com/ru/post/1204097/


All Articles