[ https://jira.codehaus.org/browse/DOXIA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=331198#comment-331198
]
Michael Osipov edited comment on DOXIA-386 at 9/9/13 2:43 PM:
--------------------------------------------------------------
After an investigation, I have found this spot: http://grepcode.com/file/repo1.maven.org/maven2/org.apache.maven.doxia/doxia-site-renderer/1.4/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java#406
So we would need to pass the encoding all way down. It would require to change a lot of change.
I have an lighter patch for that. I simply added an encoding parameter to the snippet macro
which works as desired, though I dislike what the sink does. It turns everything above 7 bit
into a entity reference but all chars get passed.
Should I upload the patch and then apply after approval?
was (Author: michael-o):
After an investigation, I have found this spot: http://grepcode.com/file/repo1.maven.org/maven2/org.apache.maven.doxia/doxia-site-renderer/1.4/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java#406
So we would need to pass the encoding all way down. It would require to change a lot of change.
I have an lighter patch for that. I simply added an encoding parameter to the snippet macro
which works as desired, though I dislike what the sink does. It turns everything above 7 bit
into a entity reference but all chars get passed.
Should a upload the patch and the apply after approval?
> 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>中文</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
|