Friday, April 04, 2008

Another reason why the Windows console is worthless

If I view a batch file in a windowed text editor, I see é (lower case e with acute accent), but if I view view it from the command prompt I see Ú (upper case u with acute accent). If I run the batch file, the character is also interpreted as Ú, which means the command fails because it is given the wrong filename.

It seems this is happening because the console uses code page 850 while graphical applications use ISO-8859-1, and they're quite different. NTFS filenames are Unicode UTF-16 and they are translated to code page 850 for the console and ISO-8859-1 for the GUI. Sometimes, such as when pasting from the GUI to a console window, the translation works. In other situations, such as copying from the console window and pasting into the GUI, it fails. What a horrible kludge!

Fortunately, Cygwin doesn't have this problem.

No comments: