Is fopen supposed to work witn non-ascii string path?



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
.



Relevant Pages

  • Re: Is fopen supposed to work witn non-ascii string path?
    ... > I'm a polish and users of my software are also polish. ... they expect to use polish characters in folders/files names. ... Unicode encoding, just that it can't encode the whole range, I get what you ... The point is that the content of the string is interpreted according to the ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Is fopen supposed to work witn non-ascii string path?
    ... Our customer want to make a Polish UI software. ... in order to use polish characters I have to use Unicode-based APIs ... > The point is that the content of the string is interpreted according to the ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: How to get Polish language characters?
    ... can you try changing the keyboard in regional setting to polish ... this assume you know or have a polish keyboard. ... unable to type Polish characters. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: how to translate foreign text to web document?
    ... > I have a paragraph of text pasted into a word document, it's in Polish, ... > complete with polish characters. ... First you must make a Scheme compiler that supports Unicode in ... Word or HomeSite. ...
    (comp.lang.scheme)
  • Re: Allowing non-ASCII identifiers
    ... > I'm all in favor of going to unicode all the way. ... Java allows for Unicode identifiers and I'm yet to see a single source ... coming from Polish and Portuguese ... background, I could argue in favor of non-ASCII identifiers, but I'm ...
    (comp.lang.python)