UTF-8 Encoding in Command Prompt
MacGyver_197 -
Hello everyone! I hope you are doing well.
I have a little problem with displaying Arabic letters in the console.
I was suggested to switch to UTF-8 encoding with the command chcp 65001 and for the moment it works. And the problem now is that the changes are not permanent.
How could I save the changes?
Please let me know how to permanently change the console encoding to UTF-8 if you have a solution to propose...
2 answers
-
Hello,
As far as I know, it's impossible; the encoding depends on the language version of Windows on the computer, and it can actually vary even within the same language depending on the command used. Sometimes I have to use 2 in the console (65001 and 1252).
If I have accents in a batch (these are special characters, it's the same principle), I use 65001, but if in the same batch a standard DOS command needs to bring back other special characters (for example, spaces), it's unreadable without 1252.
The "definitive" least risky solution is found here at <56>, all those that go through the registry are dangerous and risk crashing Windows for the reason I mentioned (using other code pages for standard Windows commands).
https://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8 -