Unable to save screenshots and world icons if the path contains non-ASCII characters
The bug
Taking a screenshot fails when the folder of your game profile contains non-ASCII characters.
18w06a
[22:40:50] [Client thread/WARN]: Couldn't save screenshot
java.io.IOException: Could not write image to the PNG file "###\screenshots\2018-02-11_22.40.50.png": Corrupt JPEG
at csp.a(SourceFile:306) ~[18w06a.jar:?]
at bxc.a(SourceFile:45) ~[18w06a.jar:?]
at bxc.a(SourceFile:30) ~[18w06a.jar:?]
at bwu.a(SourceFile:256) ~[18w06a.jar:?]
at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:23) [lwjgl-glfw-3.1.2.jar:?]
at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.1.2.jar:?]
at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:2520) [lwjgl-glfw-3.1.2.jar:?]
at bwx.b(SourceFile:803) [18w06a.jar:?]
at bwx.a(SourceFile:383) [18w06a.jar:?]
at net.minecraft.client.main.Main.main(SourceFile:141) [18w06a.jar:?]
Additionally world icons cannot be saved either.
18w06a
[22:45:42] [Client thread/WARN]: Couldn't save auto screenshot
java.io.IOException: Could not write image to the PNG file "###\saves\New World\icon.png": Corrupt JPEG
at csp.a(SourceFile:306) ~[18w06a.jar:?]
at cjr.n(SourceFile:1039) [18w06a.jar:?]
at cjr.a(SourceFile:949) [18w06a.jar:?]
at bwx.b(SourceFile:823) [18w06a.jar:?]
at bwx.a(SourceFile:383) [18w06a.jar:?]
at net.minecraft.client.main.Main.main(SourceFile:141) [18w06a.jar:?]
Besides the profile name also having non-ascii chars in the world name triggers that issue:
18w20b
java.io.IOException: Could not write image to the PNG file "D:\mc\mn\bugs\.minecraft\saves\����BUG\icon.png": Corrupt JPEG
at deq.a(SourceFile:306) ~[18w20b.jar:?]
at cvd.o(SourceFile:870) [18w20b.jar:?]
at cvd.a(SourceFile:783) [18w20b.jar:?]
at cht.c(SourceFile:820) [18w20b.jar:?]
at cht.a(SourceFile:381) [18w20b.jar:?]
at net.minecraft.client.main.Main.main(SourceFile:144) [18w20b.jar:?]
How to reproduce
- Create a folder whose name contains non-ASCII characters, for example the following
äö²³§ß
- Launch Minecraft with this folder as game directory
- Try to take a screenshot
Code analysis
Code analysis by [Mod] Pokechu22 can be found in this comment.
2017-11-09, 01:15 PM
2018-07-10, 09:50 AM
2018-06-09, 07:30 PM
10
8