You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@codehaus.org> on 2013/08/18 23:19:52 UTC

[jira] (DOXIA-386) Snippet Macro: Reference file does not support UTF-8 file format to generate the page garbage

    [ https://jira.codehaus.org/browse/DOXIA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=331043#comment-331043 ] 

Michael Osipov commented on DOXIA-386:
--------------------------------------

Just stumbled upon this with MSKINS-85. Lukas, why can't we add an {{encoding}} parameter to the snippet which one could set with a Velocity variable. This would be an easy fix.
                
> Snippet Macro:  Reference file does not support UTF-8 file format to generate the page garbage
> ----------------------------------------------------------------------------------------------
>
>                 Key: DOXIA-386
>                 URL: https://jira.codehaus.org/browse/DOXIA-386
>             Project: Maven Doxia
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: windows7 zh_CN
>            Reporter: pinghe
>
> {code:xml}
>         <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>
> {code}
> my sample apt file:
> {noformat}
> %{snippet|file=target/site/reference/html/sample.html|verbatim=false}
> {noformat}
> sample.html:
> {code:xml}
> <?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>
> {code}
> {{org.apache.maven.doxia.macro.snippet.SnippetReader}}
> readLines:
> {code}
>  reader = new BufferedReader(new InputStreamReader(source.openStream()));
> {code}
> use {{InputStreamReader(InputStream in)}}
> change to:
> {code}
>  InputStreamReader(InputStream in, Charset cs)
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira