learningunix
asked on
ascii characters
A character was written to filesystem using Windows Code Page 1251 (0xE4) but when read from DOS command prompt it is reading from MS-DOS code page 437 (0xE4) which is sigma.
Both the ascii value has different character. is there a way DOS can read the german character that was written using Windows Code Page 1251 (0xE4)
Both the ascii value has different character. is there a way DOS can read the german character that was written using Windows Code Page 1251 (0xE4)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Instead of using raster fonts in your DOS window, try using Lucida Console. On my machine, this changes the sigma symbol to the ä character without any code page changes.
ASKER
but is it possible to change programatically even if I use DOS window
ASKER
also when I do the following from command prompt:
c:> notepad test.txt
the contents are: ää
but if I do:
C:>edit test.txt
the contents are: sigma sigma character.
c:> notepad test.txt
the contents are: ää
but if I do:
C:>edit test.txt
the contents are: sigma sigma character.
Code page 1251 is wrong, you have to use 1252, which is the Windows representation of the ISO code page. If you type the German Umlauts äöü in notepad, and then use
chcp 1252
type tst.txt
You should see them again. But only if you use a font capable of the code page - raster font isn't. And you can't change that from command line, you need to change the DOS prompt window properties to use Lucida Console.
chcp 1252
type tst.txt
You should see them again. But only if you use a font capable of the code page - raster font isn't. And you can't change that from command line, you need to change the DOS prompt window properties to use Lucida Console.
You wrote that changing the code page was not enough, but have accepted that answer. May I ask why?
ASKER
from command prompt:
C:\>type temp.txt
This is printing sigma sigma character.
I tried chcp 1252, still DOS will show sigma sigma instead of those german characters ää