Is there a Windows command shell that will display Unicode characters? Is there a Windows command shell that will display Unicode characters? powershell powershell

Is there a Windows command shell that will display Unicode characters?


To do this with cmd.exe, you'll need to use the console properties dialog to switch to a Unicode TrueType font.

Then use these commands:

 CHCP 65001 DIR > UTF8.TXT TYPE UTF8.TXT

Commands:

  • Switch console to UTF-8 (65001)
  • Redirect output of DIR to UTF8.TXT
  • Dump UTF-8 to console

The characters will still need to be supported by the font to display properly on the console.

I18N: Unicode at the Windows command prompt (C++; .Net; Java)


This was a major issue in PowerShell v1. Version 2 is shipping with a "graphical shell" that corrects the problem, which is ultimately not with PowerShell, but with the Windows console host (which Cmd.exe also uses). You can get the current CTP for PowerShell v2, if you want.

Actually, PowerShell v2.0 was finalized and shipped with the release of Windows 7 and Windows Server 2008 R2 in early August. In addition, the backported versions (Windows Vista/2008) reached their Release Candidate milestone just the other day; Windows XP/Windows Server 2003 should follow very shortly. Linky linky.


Setting the codepage to UTF-8 with the command "chcp 65001" should help you print file contents correctly to the shell (using cmd.exe). This won't work for directory listings though (UTF-16 encoding in NTFS file names).