Menu

Uncode and file names

Developer
2006-01-04
2013-05-20
  • Wade Brainerd

    Wade Brainerd - 2006-01-04

    Currently there is no way to load or save a TinyXml document with a Unicode filename.

    A solution would be provide LoadFile and SaveFile functions that accept a FILE* instead of a file name.  Then you could use _topen to open the file and then pass it to TinyXml.

    Another solution would be to improve TinyXml with full Unicode support.  TinyXml would do the conversion to and from UTF-8 internally and would accept Unicode filenames in Unicode builds.

    Yet another solution would be to accept one of the many proposals for an abstract TiXmlFile class rather than relying on stdio.

    I am using #1 for now, but I would very much like to see TinyXml have proper Unicode support in the future.

    Thanks very much,

    Wade

     
    • Ellers

      Ellers - 2006-01-04

      I think a TiXmlReader (or similar) class could be a possiblity, without violating the 'tiny' principle of TinyXml. The default implementation could be the FILE* version.

      Load/Save functions with FILE* certainly seems a good idea.

      "Full Unicode support" does kinda violate the 'tiny' principle though ;) But it depends how 'full' you mean.

       
    • Lee Thomason

      Lee Thomason - 2006-01-06

      Actually, I have to disagree with this statement:

      "Currently there is no way to load or save a TinyXml document with a Unicode filename."

      The actual problem is much worse: there is no way to tell what encoding you are in. (It could be Latin-1, UTF-8, SHIFT-JIS...) Standard C/C++ doesn't define an encoding.

      A FILE* version is a good (and easy) idea.

      Using TinyXMLFile/TiXMLReader isn't bad...it just isn't very standard. And it conflicts with the stream operators which already do that.

      lee

       

Log in to post a comment.

MongoDB Logo MongoDB