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

Spaces in Filenames problem with XMLUri::normalizeURI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.8.0
    • None
    • None
    • WindowsXP 64

    Description

      When using a filename containing spaces that has been escaped by a %20 you end up with problems if the space is followed by a number. For example if you have a directory "D:\Home\Development\StrawberryFields 2.0" you need to escape it to give "D:\Home\Development\StrawberryFields%202.0" - which is obviously going to break because it confuses the 2 at the end. To fix this you escape the number following the space to give "D:\Home\Development\StrawberryFields%20%32.0" .

      This is OK in terms of providing a legal schemaLocation except....

      The routine XMLUri::normalizeURI then takes the escaped name and unescapes it to return a form the system recognises. What it needs to do is parse through the string and unescape everything - not just the %20

      void XMLUri::normalizeURI(const XMLCh* const systemURI,
      XMLBuffer& normalizedURI)
      {
      const XMLCh* pszSrc = systemURI;

      normalizedURI.reset();

      while (*pszSrc) {

      if ((*(pszSrc) == chPercent)
      && (*(pszSrc+1) == chDigit_2)
      && (*(pszSrc+2) == chDigit_0))

      { pszSrc += 3; normalizedURI.append(chSpace); }

      else

      { normalizedURI.append(*pszSrc); pszSrc++; }

      }
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            cryptonomicon Brenton Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: