How to use utf8 in javascript

I have a demo code in lang.js:

var $lang = { todayStr1: "Hôm nay" // Vietnam todayStr2: "Today" // English } 

When I get echo $ lang, the result is:

H m nay
Today

What are the ideas for fixing utf8 in javascript?

+6
source share
1 answer

you can test it when connecting lang.js

 <script type="text/javascript" src="[path]/lang.js" charset="utf-8"></script> 
+10
source

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


All Articles