Maven Doxia
  1. Maven Doxia
  2. DOXIA-133

default XML encoding (UTF-8) or XML encoding set in XML files is ignored: inputEncoding is used instead

    Details

    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      4

      Description

      Encoding can be specified per file, in the XML header: <?xml version="1.0" encoding="xxx"?>, or defaults to UTF-8

      But DefaultSiteRenderer class always read files with inputEncoding: reader = new InputStreamReader( new FileInputStream( fullPathDoc ), context.getInputEncoding() );

      When the source file is XML (xdoc, xhtml), should use XmlReader from PLXUTILS-11 to detect the XML stream encoding instead.

      Test case included in MSITE-239, site-plugin-test14

      1. DOXIA-133_doxia.diff
        4 kB
        Herve Boutemy
      2. DOXIA-133_doxia.diff
        6 kB
        Herve Boutemy
      3. DOXIA-133_doxia.diff
        5 kB
        Herve Boutemy
      4. DOXIA-133_doxia-siterenderer.diff
        3 kB
        Herve Boutemy

        Issue Links

          Activity

          Hide
          Herve Boutemy added a comment -

          +1 on Doxia.getParser(String): Parser

          -0 on Parser.getType():String
          At least, there should be constants for "text" and "xml".
          I prefer Parser.isXml() because getType() seems too open for me

          Show
          Herve Boutemy added a comment - +1 on Doxia.getParser(String): Parser -0 on Parser.getType():String At least, there should be constants for "text" and "xml". I prefer Parser.isXml() because getType() seems too open for me
          Hide
          Vincent Siveton added a comment -

          Constants was implicit for me

          IMHO isXml() is too specific for an api.

          Show
          Vincent Siveton added a comment - Constants was implicit for me IMHO isXml() is too specific for an api.
          Hide
          Herve Boutemy added a comment -

          why not, today this attribute is used only for encoding algorithm selection, but it could be used more later: such a choice is more extensible
          then go for it

          Show
          Herve Boutemy added a comment - why not, today this attribute is used only for encoding algorithm selection, but it could be used more later: such a choice is more extensible then go for it
          Hide
          Herve Boutemy added a comment -

          instead of String constants, why not use int constants, which would more clearly show that not any value can be used: each value has a precise meaning in the code
          and the code could switch(parser.getType()) instead of a suite of if (parser.getType().equals(Parser.TYPE_XML)) {} else if...

          Show
          Herve Boutemy added a comment - instead of String constants, why not use int constants, which would more clearly show that not any value can be used: each value has a precise meaning in the code and the code could switch(parser.getType()) instead of a suite of if (parser.getType().equals(Parser.TYPE_XML)) {} else if ...
          Hide
          Vincent Siveton added a comment -

          Patch applied with modifications discussed there.
          Thanks again Herve.

          Show
          Vincent Siveton added a comment - Patch applied with modifications discussed there. Thanks again Herve.

            People

            • Assignee:
              Vincent Siveton
              Reporter:
              Herve Boutemy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: