Uploaded image for project: 'IzPack'
  1. IzPack
  2. IZPACK-433

ShortcutPanel fails to load if shortcutSpec.xml is UTF-8 encoded and contains non-ascii characters

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.4, 5.0
    • Component/s: Installer
    • Labels:
      None
    • Environment:

      German Windows, Java default encoding Windows-1252

      Description

      The ShortcutPanel fails to load if shortcutSpec.xml is UTF-8 encoded and contains non-ascii characters that are correctly encoded in the XML file.
      Error message: FEHLER: 'Invalid byte 1 of 1-byte UTF-8 sequence.'
      The problem is caused by com.izforge.izpack.adaptator.impl.XMLParser:
      public IXMLElement parse( String inputString )
      {
      return parse(new ByteArrayInputStream(inputString.getBytes()));
      }
      getBytes() uses the current codepage, but the XML is UTF-8 by default.
      I suggest this implementation:
      public IXMLElement parse( String inputString )
      {
      InputSource inputSource = new InputSource( new CharArrayReader( inputString.toCharArray()));
      DOMResult result = parseLineNrFromInputSource( inputSource );
      return searchFirstElement( result );
      }

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              julienponge Julien Ponge
              Reporter:
              andreasvef Andreas Vef
            • Votes:
              2 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: