From c5b4dcb19ebe46ebcbfc6090b95aa20727680d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Wed, 1 Jun 2022 09:32:12 +0200 Subject: [PATCH] Fix character encoding in diffs (#2046) Fixes encodings in diff results. The is especially necessary for Windows systems. Co-authored-by: Eduard Heimbuch --- gradle/changelog/diff_encoding.yaml | 2 ++ .../main/java/sonia/scm/repository/api/DiffCommandBuilder.java | 3 ++- .../java/sonia/scm/repository/spi/GitDiffResultCommand.java | 3 ++- scm-ui/ui-webapp/public/index.mustache | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 gradle/changelog/diff_encoding.yaml diff --git a/gradle/changelog/diff_encoding.yaml b/gradle/changelog/diff_encoding.yaml new file mode 100644 index 0000000000..a36846b35f --- /dev/null +++ b/gradle/changelog/diff_encoding.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Character encoding in diffs ([#2046](https://github.com/scm-manager/scm-manager/pull/2046)) diff --git a/scm-core/src/main/java/sonia/scm/repository/api/DiffCommandBuilder.java b/scm-core/src/main/java/sonia/scm/repository/api/DiffCommandBuilder.java index 656329cac4..0b9dffd16e 100644 --- a/scm-core/src/main/java/sonia/scm/repository/api/DiffCommandBuilder.java +++ b/scm-core/src/main/java/sonia/scm/repository/api/DiffCommandBuilder.java @@ -36,6 +36,7 @@ import sonia.scm.repository.spi.DiffCommandRequest; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.nio.charset.StandardCharsets; import java.util.Set; //~--- JDK imports ------------------------------------------------------------ @@ -111,7 +112,7 @@ public final class DiffCommandBuilder extends AbstractDiffCommandBuilder +