Azamat Adylbekov
Azamat Adylbekov

Reputation: 63

Outputting russian characters into the console

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

Answers (1)

Zak
Zak

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

Related Questions