is there anyway to echo arabic,persian,russian,Chinese,etc texts in cmd?
(i preform not using external tools)
i serached about this and looks like i have to change the font and chcp but still i cant get the correct output i want!
tnx for your help
echoing other language texts?
Moderator: DosItHelp
Re: echoing other language texts?
In XP and earlier it's only possible if you already have an environment variable or a file/directory name containing those characters. In Windows 7 or later it's possible to build such strings in code from scratch, see viewtopic.php?f=3&t=5358 and viewtopic.php?p=34662.
Liviu
Liviu
-
- Posts: 66
- Joined: 13 Jan 2015 06:55
Re: echoing other language texts?
Use codepages 866 or 1251 to echo text in Russian. I'm from Russia and our default codepage for CMD.EXE is 866. And it's better use hex editor or Notepad++ codepage functions to enter those characters. Example of code:
Open Notepad++, change file codepage to OEM-866 and paste this code. Save it and run. It will produce correct output.
Code: Select all
@echo off
chcp 866 >nul
echo Привет &rem Russian "Hello"
Open Notepad++, change file codepage to OEM-866 and paste this code. Save it and run. It will produce correct output.
Re: echoing other language texts?
@OperatorGK, that works indeed if one only needs characters from one single codepage, such as Cyrillic 866. However, I took OP's question to be about mixing multiple scripts in the same batch, which can't be done via chcp alone - for example, there is no one codepage to cover both Cyrillic and Greek. My answer above applies to that latter case.
-
- Posts: 66
- Joined: 13 Jan 2015 06:55
Re: echoing other language texts?
If so, use cmd /U /C "script.bat". It will turn Unicode on.
Re: echoing other language texts?
'cmd /u' does indeed turn "the output of internal commands to a pipe or file" to be Unicode, but it does not affect (or matter for) the console output itself - which was the original question here. The following will work correctly at a plain 'cmd' prompt as long as it's set to use a TT (not raster) font such as Lucida Console, without '/u' and regardless of the active codepage.
Code: Select all
C:\tmp>echo àáâāăąǻ αβγδεζη абвгдеж
àáâāăąǻ αβγδεζη абвгдеж