Output Russian characters to the console

I am trying to output a Russian line to a console like this

onsole.log("");

But the console gives out this "Γ‘ € ивÐμÑ". How to solve this problem?

+4
source share
1 answer

You need to declare the encoding of your site (or scripts).

You can use <meta charset="UTF-8">in HEADyour site to indicate that the entire page will be UTF-8encoded. -

OR

If you just need your script to encode. You can encode JUST script - IE<script type="text/javascript" charset="utf-8" src="blah.js"/>

In any case, you should always indicate your site / script the character set that you use.

+3
source

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


All Articles