Is fopen supposed to work witn non-ascii string path?
- From: Mateusz Łoskot <see.my@xxxxxxxxxxxxx>
- Date: Tue, 20 Dec 2005 07:21:34 +0100
Hi,
If you don't mind, I'll give you a little background explanation.
I'm a polish and users of my software are also polish (mostly).
So, they expect to use polish characters in folders/files names.
Polish characters in ASCII stings are encoded using ISO-8859-2 (lating2) encoding. Obviously, there is no problem when working with Unicode only strings. Sometimes, I have to use external libraries written in C language which are based on CRT and its ASCII- based calls like fopen.
Yesterday, I did some short research and I revealed that I can not use fopen function with path containing non standard ASCII (outside us-ascii) characters.
So, in order to use polish characters I have to use Unicode-based APIs like CreateFile or _wfopen.
Here is a small screenshot with small WinMain function including 3 tests: fopen, wfopen and CreateFile.
As you can see, I pass them file path with polish characeters:
http://mateusz.loskot.net/chwila/fopen-ascii-unicode.jpg
(I decided to show you a screenshot to be sure polish characters are displayed correctly)
As I tested using VC++ 7.1 on my Windows XP based machine, I can use fopen with polish characters successfuly.
So, I suppose it works slightly different on Windows CE, where obviously filesystem is Unicode based and many other factors play their role here.
Am I right?
Now comes my question.
Is there any way to force fopen to work with non-Unicode strings containing non us-ascii characters (extended ASCII as I remember correctly, like Latin2)?
Or I have to rewrite libraries I use to change fopen to wfopen call?
Thanks in advance for any advice.
-- Mateusz Łoskot http://mateusz.loskot.net .
- Follow-Ups:
- Re: Is fopen supposed to work witn non-ascii string path?
- From: Ulrich Eckhardt
- Re: Is fopen supposed to work witn non-ascii string path?
- Prev by Date: Re: WINCE registry edit
- Next by Date: Re: Is fopen supposed to work witn non-ascii string path?
- Previous by thread: Re: How can I resize my bitmap picture?
- Next by thread: Re: Is fopen supposed to work witn non-ascii string path?
- Index(es):
Relevant Pages
|