If I'm not mistaken, every char* return value is UTF-8 encoded. Is it possible to use UTF-8-encoded filenames for LoadFile? Since I noticed the use of fopen, I guess not but I wanted to ask to be sure...
Also, are others using TinyXML for development on Windows CE? What should I be aware of?
Best regards,
Merijn
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That is a *very* good point. There isn't a fix (TinyXML is cross-platform and C doesn't provide a UTF-8 file load) but it should be documented. The character pointer (or string) you pass to LoadFile will get passed straight to fopen, unmodified.
The encoding that fopen will use depends on your OS. I'll add some notes to the docs.
lee
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is a big problem with fopen when use will pas filenames with non us-ascii characters (charactes from extended ASCII set) like Latin2 (ISO-8859-2).
Look at this screenshot where you will see polish characters in the filename and fopen will fail in such case: http://mateusz.loskot.net/chwila/fopen-ascii-unicode.jpg
I think TinyXML could be Unicode filenames aware using wfopen call which is available on Windows NT/2000/XP and Windows CE.
I'm not sure what about wfopen on Unix'es?
What do you think about it?
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I'm not mistaken, every char* return value is UTF-8 encoded. Is it possible to use UTF-8-encoded filenames for LoadFile? Since I noticed the use of fopen, I guess not but I wanted to ask to be sure...
Also, are others using TinyXML for development on Windows CE? What should I be aware of?
Best regards,
Merijn
That is a *very* good point. There isn't a fix (TinyXML is cross-platform and C doesn't provide a UTF-8 file load) but it should be documented. The character pointer (or string) you pass to LoadFile will get passed straight to fopen, unmodified.
The encoding that fopen will use depends on your OS. I'll add some notes to the docs.
lee
Recently, I noticed this problem too.
Here is also my longer post on one of Windows CE groups:
"Is fopen supposed to work witn non-ascii string path?"
http://groups.google.pl/group/microsoft.public.windowsce.embedded.vc/browse_frm/thread/ca0d4f04a2e5abdf/a8762baf4c140ba9
There is a big problem with fopen when use will pas filenames with non us-ascii characters (charactes from extended ASCII set) like Latin2 (ISO-8859-2).
Look at this screenshot where you will see polish characters in the filename and fopen will fail in such case:
http://mateusz.loskot.net/chwila/fopen-ascii-unicode.jpg
I think TinyXML could be Unicode filenames aware using wfopen call which is available on Windows NT/2000/XP and Windows CE.
I'm not sure what about wfopen on Unix'es?
What do you think about it?
Cheers
There is a small problem with the test app presented on the screenshot, as Ulrich Eckhardt suggested:
"It is invalid C or C++ to embed these characters into sourcecode. You are relying on compiler-specific support."
But I'm correct that it does not change the problem I noticed.
Cheers