提交 8a73c250 编写于 作者: K kohsuke

Fixed the charset encoding handling when different encodings are involved...

Fixed the charset encoding handling when different encodings are involved between the master and slaves.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21664 71c3de6d-444a-0410-be80-ed276b4c234a
上级 73f1b2eb
......@@ -899,14 +899,16 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
public Reader getLogReader() throws IOException {
File logFile = getLogFile();
if (logFile.exists() ) {
return new FileReader(logFile);
if (charset==null) return new FileReader(logFile); // fall back
return new InputStreamReader(new FileInputStream(logFile),charset);
}
File compressedLogFile = new File(logFile.getParentFile(), logFile.getName()+ ".gz");
if (compressedLogFile.exists()) {
return new InputStreamReader(
new GZIPInputStream(
new FileInputStream(compressedLogFile)));
GZIPInputStream is = new GZIPInputStream(new FileInputStream(compressedLogFile));
if (charset==null) return new InputStreamReader(is);
else return new InputStreamReader(is,charset);
}
return null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册