Skip to content

Commit

Permalink
Fix transformJson mis-encoding.
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 committed Sep 30, 2024
1 parent 799759a commit 2c7e933
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/fabricmc/loom/util/ZipUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static <T> int transformJson(Class<T> typeOfT, Path zip, Stream<Pair<Stri
}

public static <T> int transformJson(Class<T> typeOfT, Path zip, Map<String, UnsafeUnaryOperator<T>> transforms) throws IOException {
return transformMapped(zip, transforms, bytes -> LoomGradlePlugin.GSON.fromJson(new InputStreamReader(new ByteArrayInputStream(bytes)), typeOfT),
return transformMapped(zip, transforms, bytes -> LoomGradlePlugin.GSON.fromJson(new InputStreamReader(new ByteArrayInputStream(bytes), StandardCharsets.UTF_8), typeOfT),
s -> LoomGradlePlugin.GSON.toJson(s, typeOfT).getBytes(StandardCharsets.UTF_8));
}

Expand Down

0 comments on commit 2c7e933

Please sign in to comment.