mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-08 01:26:03 +00:00
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
This commit is contained in:
1 parent
73f1b2ebac
commit
8a73c25000
1 file changed
+6
-4
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user