Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use UTF8 in javascript

I have a code demo in lang.js:

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

When I echo $lang result is :

H?m nay
Today

How to ideas for fix utf8 in JavaScript?

like image 669
Hai Truong IT Avatar asked Dec 13 '11 04:12

Hai Truong IT


1 Answers

you can test it when attach lang.js

<script type="text/javascript" src="[path]/lang.js" charset="utf-8"></script>
like image 79
NrNazifi Avatar answered Sep 20 '22 23:09

NrNazifi