Menu

UNICODE filenames

2005-11-17
2013-05-20
  • Merijn Vandenabeele

    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

     
    • Lee Thomason

      Lee Thomason - 2005-11-22

      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

       
      • Mateusz Loskot

        Mateusz Loskot - 2005-12-20

        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

         
    • Mateusz Loskot

      Mateusz Loskot - 2005-12-21

      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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.