Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1916

TranscodeFromStr fails with invalid UTF8 encoded strings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.1.1, 3.2.0
    • Utilities
    • None
    • WIN32, Solaris32

    Description

      If you got an invalid encoded UTF-8-sequence, the TranscodeFromStr ends up by throwing a OutOfMemoryException and if you use XMLTranscoder::transcodeFrom() directly you'll somehow probably end up in a loop that never ends, 'cause it stops to consume/eat bytes. Shouldn't there be some "InvalidEncodingException" instead ?

      ...
      const char string[] = "HÖPP";
      const int size = strlen( string);
      xercesc::TranscodeFromStr transcoder( reinterpret_cast<const XMLByte *>(string), size, "UTF8");
      // OutOfMemoryException

      Attachments

        Activity

          People

            amassari Alberto Massari
            kristone Kristian Ivarsson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: