提交 0224cbc3 编写于 作者: C Costin Leau

SPR-6794

+ used UTF-8 as the implicit encoding for reading scripts
上级 44626054
...@@ -79,20 +79,9 @@ public class ResourceScriptSource implements ScriptSource { ...@@ -79,20 +79,9 @@ public class ResourceScriptSource implements ScriptSource {
synchronized (this.lastModifiedMonitor) { synchronized (this.lastModifiedMonitor) {
this.lastModified = retrieveLastModifiedTime(); this.lastModified = retrieveLastModifiedTime();
} }
Reader reader = null;
try { Reader reader = new InputStreamReader(this.resource.getInputStream(), "UTF-8");
// Try to get a FileReader first: generally more reliable.
reader = new FileReader(getResource().getFile());
}
catch (IOException ex) {
if (logger.isDebugEnabled()) {
logger.debug("Could not open FileReader for " + this.resource +
" - falling back to InputStreamReader", ex);
}
}
if (reader == null) {
reader = new InputStreamReader(this.resource.getInputStream());
}
return FileCopyUtils.copyToString(reader); return FileCopyUtils.copyToString(reader);
} }
...@@ -128,5 +117,4 @@ public class ResourceScriptSource implements ScriptSource { ...@@ -128,5 +117,4 @@ public class ResourceScriptSource implements ScriptSource {
public String toString() { public String toString() {
return this.resource.toString(); return this.resource.toString();
} }
}
} \ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册