Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.0-beta-3</version>
<version>1.0-beta-4</version>
</extension>
</extensions>
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.14</version>
<version>3.19</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down Expand Up @@ -64,11 +64,11 @@
<properties>
<revision>2.24</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.62</jenkins.version>
<jenkins.version>2.73.3</jenkins.version>
<java.level>8</java.level>
<no-test-jar>false</no-test-jar>
<workflow-support-plugin.version>2.17</workflow-support-plugin.version>
<scm-api-plugin.version>2.1.1</scm-api-plugin.version>
<workflow-support-plugin.version>2.20</workflow-support-plugin.version>
<scm-api-plugin.version>2.2.6</scm-api-plugin.version>
<git-plugin.version>3.2.0</git-plugin.version>
<jenkins-test-harness.version>2.33</jenkins-test-harness.version>
</properties>
Expand Down Expand Up @@ -104,7 +104,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
<version>1.7</version>
<version>1.10</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
Expand Down Expand Up @@ -230,7 +229,7 @@ StreamBuildListener getListener() {
if (listener == null) {
try {
OutputStream logger = new FileOutputStream(getLogFile(), true);
listener = new StreamBuildListener(logger, Charset.defaultCharset());
listener = new StreamBuildListener(logger, getCharset());
} catch (FileNotFoundException fnf) {
LOGGER.log(Level.WARNING, "Error trying to open build log file for writing, output will be lost: "+getLogFile(), fnf);
return NULL_LISTENER;
Expand Down Expand Up @@ -282,6 +281,7 @@ public WorkflowRun(WorkflowJob job, File dir) throws IOException {
}
try {
onStartBuilding();
charset = "UTF-8"; // cannot override getCharset, and various Run methods do not call it anyway
StreamBuildListener myListener = getListener();
myListener.started(getCauses());
Authentication auth = Jenkins.getAuthentication();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,4 +469,12 @@ private void assertCulprits(WorkflowRun b, String... expectedIds) throws IOExcep
}
}

@Issue("JENKINS-31096")
@Test public void unicode() throws Exception {
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
String message = "¡Čau → there!";
p.setDefinition(new CpsFlowDefinition("echo '" + message + "'", true));
r.assertLogContains(message, r.buildAndAssertSuccess(p));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Windows (ISO-8859-1), this fails with mojibake with the charset = "UTF-8" line commented out, or with the upstream PR not integrated.

}

}