On 23 Apr 01, at 17:25, Frank Heckenbach wrote:
Prof. A Olowofoyeku (The African Chief) wrote:
Are there libraries or routines that are usable with GPC for dealing with character sets? For example the WinAPI has routines such as OemToChar (or OemToAnsi for 16-bit Windows) to deal with converting strings between "oem" character sets and "ansi". I can use these for what I am doing, but I would lose portability while so doing.
Does "OEM charset" mean this charset used on Dos originally?
No. I am not sure what *precisely* it is supposed to mean, but the idea is to convert between character sets. For example, if you have some text written in Danish, some of the characters would be wrongly displayed in English versions of Windows unless you first convert the text. Here, the Danish text would be the "OEM" characters, and the converted text would be the "ansi" or whatever.
I don't think it's in use anywhere else (except within conversion programs etc.), so you probably won't find conversion routines in standard libraries on other systems. (What might be available is conversion between charsets like ISO-8859-n and Unicode (which is trivial for n=1, i.e. latin-1 charset which AFAIK is also the default on (recent?) Windoze versions in west European locales).)
You could try to take the code from programs such as recode. I'm not sure what you're trying to achive -- if you want make a program able to read old Dos charset files because they're still common on Windoze, you can probably just do no conversion on Unix etc. (where normal programs aren't expected to deal with Dos charset files).
What I am trying to do is to get the program to recognise and translate non-English characters correctly. For example, in my unzip code, unless I do this, certain characters in filenames inside the zip file (e.g., umlauts, or accented characters) might end up being wrong, and the file when extracted then get a wrong name (or trying to create it fails because the name contains "illegal" characters).
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) Author of: Chief's Installer Pro for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm Email: African_Chief@bigfoot.com