On 24 Apr 01, at 3:00, Frank Heckenbach wrote:
[...]
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).
So the system uses different charsets for file names and for text I/O?
To be honest with you, I am not sure. All I know is that a Danish or German word (i.e., with characters that are not in the normal English alphabet) will, if not converted from "OEM" to "Ansi" (or now, to "char"), not display correctly, and, if it is a filename, then the filename will not be correct either. So, to display the text or create the file correctly, you need to do the conversion first.
You could look at the Info-ZIP code to see if/how it handles the issue under Unix, or try some zip file with problematic characters and see if unzip under Linux does any conversion and if the result is correct. (If you don't have a Linux machine handy, you can send me such a file to try it.)
unzip fails most miserably under Linux. Of course, "unzip -l" displays the supposed contents of the zip file, but the names are totally wrong (truncated in most cases on encountering the first "foreign" character). "unzip -d" makes a brave attempt to extract the files, but all the "foreign" characters in the filenames are replaced by the "?" character. So the filenames are totally wrong as well. Windows tries to make some sense of the characters - but unzip under Linux doesn't even try (which is what I assume the question marks to mean).
I can send you a sample zip file if you want.
So the question of how to convert these "foreign" characters to something that the OS can understand remains. Like I said before, there is a simple WinAPI routine that does that, but I am trying to find a portable solution from gcc or other (L)GPL libraries.
It may of course be that my Linux (Mandrake 7.1) is broken - but I don't see why that should be so, since everything else works.
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