Reputation: 63
I am trying to output a russian string into the console like this
сonsole.log("Привет");
But the console ouputs this ПривеÑ. How to solve this problem?
Upvotes: 4
Views: 804
Reputation: 7525
You need to declare your site's (or scripts for that matter) encoding.
You can use <meta charset="UTF-8">
in the HEAD
of your site to tell the whole page to be UTF-8
encoded. --
OR
If you just need your script to be encoded .. You can encode JUST the script -- IE <script type="text/javascript" charset="utf-8" src="blah.js"/>
Either way you should always tell your site/script which character set you are using.
Upvotes: 3