Xerces-C++
  1. Xerces-C++
  2. XERCESC-1947

XMLUTF8Transcoder::transcodeTo fails with an exception when transcoding single characters that require 3 or more bytes as UTF8.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0, 3.1.1
    • Fix Version/s: 3.2.0
    • Component/s: Utilities
    • Labels:
      None
    • Environment:
      Tested on mac os and debian linux. The failure is only manifest on v3.1.x

      Description

      This can be demonstrated with the following 2 lines of code.

      const XMLCh uval [] =

      { 0x254B, 0x0000}

      ; //BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL (needs 3 bytes for utf-8)
      char* uc = (char*)TranscodeToStr(uval,"UTF-8").adopt(); cout << uc << endl << flush; XMLString::release(&uc); //faulty exception;

      The error is: "terminate called after throwing an instance of 'xercesc_3_1::TranscodingException'"

      1. TransService.cpp.patch
        5 kB
        Lee Doron
      2. TransService.patch
        1 kB
        Ben Griffin
      3. transtest.cpp
        0.7 kB
        Ben Griffin

        Issue Links

          Activity

          Ben Griffin created issue -
          Ben Griffin made changes -
          Field Original Value New Value
          Attachment transtest.cpp [ 12456693 ]
          Ben Griffin made changes -
          Attachment TransService.patch [ 12456694 ]
          Ben Griffin made changes -
          Component/s Utilities [ 11066 ]
          Boris Kolpackov made changes -
          Fix Version/s 3.1.2 [ 12315014 ]
          Fix Version/s 3.2.0 [ 12314395 ]
          Ben Griffin made changes -
          Priority Critical [ 2 ] Minor [ 4 ]
          Mark Thomas made changes -
          Workflow jira [ 12523731 ] Default workflow, editable Closed status [ 12573888 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12573888 ] jira [ 12596971 ]
          Lee Doron made changes -
          Attachment TransService.cpp.patch [ 12473766 ]
          Alberto Massari made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Alberto Massari [ amassari ]
          Fix Version/s 3.1.2 [ 12315014 ]
          Resolution Fixed [ 1 ]
          Dan PV made changes -
          Link This issue relates to XERCESC-1984 [ XERCESC-1984 ]
          Lee Doron made changes -
          Link This issue relates to XERCESC-1987 [ XERCESC-1987 ]

            People

            • Assignee:
              Alberto Massari
              Reporter:
              Ben Griffin
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development