Skip to content

Commit

Permalink
Fix transformJson mis-encoding. (#240)
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 authored Dec 7, 2024
1 parent 689ba0b commit f798274
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 @@ -211,7 +211,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 f798274

Please sign in to comment.