Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
-4
rated 0 times [  3] [ 7]  / answers: 1 / hits: 21412  / 9 Years ago, thu, july 2, 2015, 12:00:00

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 following:


> Probléma a működésben.

The non ASCII characters are messed up, but I don't think the reason for this is that the console doesn't support Unicode characters, because if I paste the log straight into the console it produces the proper output.


I tested it in Opera, Firefox, Chrome. Happens in Win 8.1 and OSX too, so we can say this is general.


Are there other things that should persist for the proper Unicode console logging, like HTML charset or file encode?


More From » unicode

 Answers
5

I found out that if you set the proper charset in a <meta> tag in the <head> it will work:



<meta charset=UTF-8>

[#65952] Tuesday, June 30, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jonmicahm

Total Points: 603
Total Questions: 120
Total Answers: 108

Location: Guam
Member since Fri, Jul 31, 2020
4 Years ago
;