Uploaded image for project: 'Maven Doxia'
  1. Maven Doxia
  2. DOXIA-386

Snippet Macro: Reference file does not support UTF-8 file format to generate the page garbage

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.2
    • Fix Version/s: 1.6
    • Component/s: Core
    • Labels:
      None
    • Environment:
      windows7 zh_CN

      Description

              <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                  <locales>zh_CN</locales>
                  <inputEncoding>UTF-8</inputEncoding>
                  <outputEncoding>UTF-8</outputEncoding>
                </configuration>
              </plugin>
      

      my sample apt file:

      %{snippet|file=target/site/reference/html/sample.html|verbatim=false}
      

      sample.html:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"><head><title>&#20013;&#25991;</title></head><body></body></html>
      

      org.apache.maven.doxia.macro.snippet.SnippetReader

      readLines:

       reader = new BufferedReader(new InputStreamReader(source.openStream()));
      

      use InputStreamReader(InputStream in)
      change to:

       InputStreamReader(InputStream in, Charset cs)
      

        Attachments

        1. DOXIA-386.patch
          3 kB
          Michael Osipov

          Issue Links

            Activity

              People

              • Assignee:
                michael-o Michael Osipov
                Reporter:
                pinghe pinghe
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: