How to save a list of directory with files containing Russian or Chinese characters (Windows7)

Kasia Luiss picture Kasia Luiss · Apr 16, 2013 · Viewed 7.7k times · Source

I need from time to time to make a list of files from a CD I obtain. These files' names contain frequently characters in other writing systems, like Cyrillic Russian (Добродошли.doc) or simplified/traditional Chinese (孟子譯注.pdf). My computer (running under Windows 7, Polish) displayes the file names correct, opens the files, saves the files in other locations, lets the files be edited by various software etc. Yet when I am making a directory list (with the dir command) I always obtain question marks and other strange characters instead of the other (Chinese, Russian) characters - the output of the dir command by default seems to be written in ANSI by default - instead of Unicode / UTF8.

Example:

02.03.09 21:13 15˙584˙500 ??????(??????).pdf     = these three files were in Chinese
02.03.09 03:11 18˙638˙982 ????(???).pdf
24.03.08 17:25 61˙141˙454 ???®????Ż(???).pdf 
18.03.13 16:00 1˙088 ????.txt                    = this file's name was in Russian 
02.03.09 21:20 26˙083˙641 Transformations-of-Ming.pdf

(obtained with the Windows Right-Click Context Menu "Print Directory Listing")

I have tried searching www for various advice to this problem, and none of the solutions offered has solved my problem - alternatively I have found (seemingly dated) answers that the problem for the time being cannot be solved under various environments. Maybe something has changes - maybe there is a solution, straigh away or after having changed something within the registry of Windows? Or else, if there is no simple batch programming solution - maybe there is some ready software that I could download (for free or buying) to solve my problem?

I am not familiar with Java or php programming and I don't know how to deal with Ruby either (there are similar questions here but restricted to these enviroments). I can say I got stuck on MS-DOS batch programming - I used to be very good in batch programming in the end of 1980-ies till mid-1990ies, also in even complex WordPerfect 5.1 for DOS macro commands editing/creating, and other types of string programming - maybe I am too old (don't ask me, how old, please) to learn advanced object oriented programming (I have never been a programmer, just a computer fan, but after Windows 98 I had to give up).

Thanks for any suggestions - I will try them all (if any).

Answer

Endoro picture Endoro · Apr 16, 2013

First, you need a True Type font (TTF) with foreign character support. Install the font:

  • right mouse click on the title bar
  • choose Properties/Fonts
  • if your font is NOT in the list, you must add it before in the registry with the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont\

After installing the font the console displays all foreign characters supported by this font. Commands like dir or redirection to a file dir > dir.txt does also work. And there is no need to change the codepage with chcp.