Fixes to loading template/script files from the classpath as UTF-8 by default.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6193 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-07-09 11:12:23 +00:00
parent cce11fa38b
commit 6b983aafec
3 changed files with 30 additions and 11 deletions

View File

@@ -163,7 +163,7 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess
FileCopyUtils.copy(stream, os); // both streams are closed
byte[] bytes = os.toByteArray();
return executeScriptImpl(resolveScriptImports(new String(bytes)), model);
return executeScriptImpl(resolveScriptImports(new String(bytes, "UTF-8")), model);
}
catch (Throwable err)
{
@@ -379,7 +379,7 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess
FileCopyUtils.copy(stream, os); // both streams are closed
byte[] bytes = os.toByteArray();
// create the string from the byte[] using encoding if necessary
result = new String(bytes);
result = new String(bytes, "UTF-8");
}
catch (IOException err)
{