Convert ANSI to OEM

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Peter JEnsen

Convert ANSI to OEM

Post by Peter JEnsen »

How can I get Textpad to convert an ANSI file to OEM(CP850) and can it do it automatic like at batch job???
Berend

Re: Convert ANSI to OEM

Post by Berend »

Peter,

You can 'Save As' and in the encoding dropdown box choose DOS. However this won't translate any characters, special characters will be displayed with the character that happens to have the same 'ascii' value, e.g. Ansi è will be displayed as þ.
Do a search on 850 or 1252 in the TP help to see the full set of characters.

To 'translate' characters you would have to do a number of search and replaces, for instance search è, replace with Š, then save as DOS et voila, it's è again.
Mind that you will always lose some characters that exist in Ansi but not in DOS, for instance é.

There are also utilities on the net that do this for you, search google, or, if you have VB or Delphi or the like, you can create something yourself, look for CharToOem and/or OemToChar API functions. Hell, I already have it, let me know if you want the executable.

Berend
Berend

Re: Convert ANSI to OEM

Post by Berend »

I just noticed there's a 'Convert to DOS' / 'Convert to ANSI' menu under 'Tools'...

Berend
Post Reply