Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-121714

Unable to save screenshots and world icons if the path contains non-ASCII characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 17w45a, Minecraft 17w45b, Minecraft 18w06a, Minecraft 18w08b, Minecraft 18w10a, Minecraft 18w10b, Minecraft 18w15a, Minecraft 18w20c, Minecraft 18w21a, Minecraft 18w22b, Minecraft 18w22c
    • Confirmed

      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

      1. Create a folder whose name contains non-ASCII characters, for example the following
        äö²³§ß
        
      2. Launch Minecraft with this folder as game directory
      3. Try to take a screenshot

      Code analysis

      Code analysis by pokechu22 can be found in this comment.

            boq [Mojang] Bartosz Bok
            8000超威光头 陈执一
            Votes:
            10 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: