fixed encoding used when reading HelpMojo Velocity template

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1405266 13f79535-47bb-0310-9956-ffa450edef68
master
Herve Boutemy 2012-11-03 02:37:32 +00:00
parent 2077b3e8cf
commit 4a1d287e0f
1 changed files with 6 additions and 1 deletions

View File

@ -50,6 +50,7 @@ import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Properties;
@ -195,9 +196,13 @@ public class PluginHelpGenerator
InputStreamReader isReader = null;
try
{
isReader = new InputStreamReader( is ); // FIXME platform encoding
isReader = new InputStreamReader( is, "UTF-8" ); // plugin-tools sources are UTF-8 (and even ASCII in this case)
velocityComponent.getEngine().evaluate( context, stringWriter, "", isReader );
}
catch ( UnsupportedEncodingException e )
{
// not supposed to happen since UTF-8 is supposed to be supported by any JVM
}
finally
{
IOUtil.close( is );