Uploaded image for project: 'MidPoint'
  1. MidPoint
  2. MID-6755

Prism and DOMUtils expects UTF8 everywhere

    XMLWordPrintable

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.2
    • None
    • Infra
    • None
    • No subscription (community)
    • 4.4

    Description

      DOMUtil and prism parser classes (and probably others) silently expect UTF-8 everywhere. This fails when -Dfile.encoding option is set to something else. For example Intellij idea on windows usesĀ -Dfile.encoding=windows-1250. Then we're getting errors like :

      Caused by: org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.Caused by: org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at com.evolveum.midpoint.util.DOMUtil.parse(DOMUtil.java:271)

      All methods that take just InputStream parameter should also have Charset parameter at least optional. Currently there's no way of parsing file that is utf8 without bom on windows when it goes through parser/domutils internally.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lazyman Viliam Repan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: