I have a hungarian statement that I would like to log to the console like this:
console.log(\'Probléma a működésben.\');
But it prints the
First way: you have to find your characters in unicode table
console.log( '\u03A9' )
; // Ω
Second way - use unidecode npm package.
You can specify the encoding of your file by setting the charset attribute
<script src="script.js" type="text/javascript" charset="utf-8"/>
I found out that if you set the proper charset in a <meta>
tag in the <head>
it will work:
<meta charset="UTF-8">