Menu

UNICODE support

2002-04-23
2002-07-18
  • Wayne Wagler

    Wayne Wagler - 2002-04-23

    I like TinyXML.  It provides the functionality that I need and was easy to integrate.  I need to support UNICODE and can see both in the code and documentation that it is ASCII only 8bit char's at present.  Any plans to support UNICODE?  Do you know of any other C++ parsers that support UNICODE?  My search of sourceforge didn't find any.  How hard would it be for me to convert it over?   It seems that STL strings are single byte and would need to be ripped out.

    Thanks,
    Wayne

     
    • Lee Thomason

      Lee Thomason - 2002-04-24

      No current proposal for unicode; the most important work at this point is the optional STL work. Although in that context, Unicode support would certainly be possible. It's a very compelling feature.

      STL strings can be of any type...but implementing that somewhat exceeds my current STL mojo.

      As to other parsers, I'm don't know of any small ones that do. The "big ones" generally do. (IBM, MS)

      lee

       
    • Wayne Wagler

      Wayne Wagler - 2002-04-26

      My plan now is to use the James Clark expat C parser as it does support UNICODE (UTF-16).  TinyXML gave me a good start however. 
      Thanks,
      Wayne

       
    • Anonymous

      Anonymous - 2002-07-18

      By adding the following function and #ifdef to the top tinyxmlparser.cpp you can use UTF8 character sets which won't help you with double byte UNICODE, is a simple solution for single byte.

      Which means that tinyxml can now process:
      <?xml version="1.0" standalone="no" ?>
      <!-- Our to do list data -->
      <examples>
          <example>Bsico</example>
          <example>Mxico</example>
      </examples>

      bool bfIsSpace(int iChar) {
          bool bRetVal = false;
          if ((iChar >= 0) && (iChar <= 255)) {
              switch (iChar) {
                  case '\r' :
                  case '\n' :
                  case ' '  : bRetVal = true;
                              break;
              }
          }
          return bRetVal;
      }

      #ifdef USE_UTF8
      #define isspace bfIsSpace
      #ifdef

      Chuck

       

Log in to post a comment.