[MC-2215] Encoding errors in server.properties Created: 04/Nov/12 Updated: 09/May/23 Resolved: 09/May/23 |
|
| Status: | Resolved |
| Project: | Minecraft: Java Edition |
| Component/s: | None |
| Affects Version/s: | Minecraft 1.4.2, Minecraft 1.4.3, Minecraft 1.4.4, Minecraft 1.4.7, Minecraft 1.5, Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 1.7.4, Minecraft 14w05b, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 1.8, Minecraft 15w49b, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 1.11.2, Minecraft 1.12.2, Minecraft 18w16a, Minecraft 1.13.1, 1.14.4, 1.16.1, 20w27a, 1.18.2, 1.19.3, 23w05a |
| Fix Version/s: | 1.20 Pre-release 1 |
| Type: | Bug | ||
| Reporter: | Carl Fürstenberg | Assignee: | [Mojang] Bartosz Bok |
| Resolution: | Fixed | Votes: | 32 |
| Labels: | encoding, server.properties, utf8 | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| CHK: | |||||||||||||||||
| Confirmation Status: | Confirmed | ||||||||||||||||
| Category: |
Text
|
||||||||||||||||
| Mojang Priority: | Normal | ||||||||||||||||
| Description |
The bugThe server.properties file doesn't seems to handle unicode UTF-8 correctly, while still trying to recode it as such. This is most apparent on motd where you can't type non-ascii characters and save it as UTF-8. For example if trying to change motd to "motd=§lA Minecraft Server", when the server starts, the properties file change it into "motd=\u00C2\u00A7lA Minecraft Server" and the multiplayer screen shows gibberish. You can though somehow overcome this by encode the file as latin1 (iso-8859-1). While the server.properties still gets changed into "motd=\u00A7lA Minecraft Server", at least it shows up correctly in the multiplayer list. This happens off course for all non-ascii characters, like ß, Å, etc. Cause and suggested fix from Orthotope:
|
| Comments |
| Comment by Brain81505 [ 11/Feb/23 ] |
|
Can confirm in 23w06a |
| Comment by Brain81505 [ 01/Feb/23 ] |
|
Can confirm in 23w05a and 1.19.3 |
| Comment by Anaerin [ 22/Apr/22 ] |
|
Confirmed (Still) in 1.18.2 on FreeBSD |
| Comment by [Mod] j_p_smith [ 05/Jul/20 ] |
|
Confirmed in 1.16.1 and 20w27a. |
| Comment by liach [ 14/Oct/19 ] |
|
just switch the call from Files.newInputStream/newOutputStream to Files.newBufferedReader/newBufferedWriter and things will be fine. it isn't that hard, just a one line fix in abstract property handler. |
| Comment by James [ 14/Oct/19 ] |
|
Still present in the 1.14.4 jar. (Feels weird to report it, though, because it's more of a feature request to support unicode.) |
| Comment by Marcono1234 [ 07/Dec/15 ] |
|
Confirmed for
|
| Comment by dx [ 11/Nov/14 ] |
|
§ is not the only non-ascii character in the world. You may not need characters outside of the ASCII set, but other people do.
That's supposed to read "ばか". |
| Comment by Leo Harvey [ 11/Nov/14 ] |
|
OK so I don't know a lot about this weird coding stuff but I can say that even though its changing the text for me it still runs fine no weird text on my server more even though it does not use ¢ looking thing (on tablet sorry) and its in color and all so I don't get how this is a bug |
| Comment by Jim Rees [ 15/Oct/14 ] |
|
Still broken in 1.8 despite what the status says. Also why is it "unconfirmed"? |
| Comment by dx [ 15/Oct/14 ] |
|
"Resolved - awaiting response"? Wat. Still happening with minecraft_server.1.8.1-pre1.jar |
| Comment by user-f2760 (Inactive) [ 09/Jul/14 ] |
|
you mean 27b |
| Comment by Deleted account [ 09/Jul/14 ] |
|
Is this still a concern in the current Minecraft version 14w21b / Launcher version 1.4.4 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. |
| Comment by user-f2760 (Inactive) [ 26/Apr/14 ] |
|
the changeing of what you type, I can confirm, however that it changes to weird text I cannot because it has always worked for me propperly |
| Comment by Leo Thomas Harve [ 26/Apr/14 ] |
|
I did that for world with the random characters thing and file name was the sish thing then k and in server.propertys it was that weird coding and the server ran the file I wanted so no effect |
| Comment by Jim Rees [ 21/Feb/14 ] |
|
Still broken in 14w08a. |
| Comment by [Mod] Ezekiel (ezfe) [ 21/Feb/14 ] |
|
Is this still a concern in the latest Minecraft version 14w08a? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. |
| Comment by Jim Rees [ 27/Oct/13 ] |
|
This is still a problem with 1.7.2. How do you update the affected versions? |
| Comment by ANBO Motohiko [ 13/Jul/13 ] |
|
I can still reproduce this issue on 1.6.2 server/client. And when I set Japanese characters on server.properties file like this: motd=Minecraft\u30B5\u30FC\u30D0\u30FC the client don't show them properly. |
| Comment by Orthotope [ 04/Apr/13 ] |
|
Looking at the code, the problem here is the use of the java.util.Properties.load(InputStream) and Properties.store(OutputStream, String) methods. Both of these assume the use of ISO 8859-1 encoding, and this cannot be changed. The solution is to use the Properties.load(Reader) and Properties.store(Writer, String) methods instead; InputStreamReader and OutputStreamWriter can be used to wrap the FileInputStream and FileOutputStream respectively and specify the UTF-8 charset. As for the current behavior, non-ascii characters are encoded as (slightly modified) UTF-8, then written to file as escaped Unicode characters; when read, the escape sequences are handled properly, but it is not converted back into UTF-8. The section sign (§, \u00a7) happens to be encoded as \u00c2\u007a (§), so formatting codes work, aside from adding an extra character. Many other characters do not contain themselves when encoded (such as ÷ (\u00f7), encoded as \u00c3\u00b7 (÷)). |
| Comment by Jim Rees [ 18/Mar/13 ] |
|
Still affects 1.5. |
| Comment by Jim Rees [ 08/Feb/13 ] |
|
This bug still exists in 1.4.7 server. I'm a bit surprised by this one. Aren't you guys Swedish? Don't you use non-ascii characters? |
| Comment by dx [ 03/Dec/12 ] |
|
Stumbled upon this one while trying to set fabulous unicode to my motd. This was very frustrating. I workarounded this bug quickly, since after the first restart i saw it was converting my utf-8 into hex escapes but decoding as latin1. So I simply used a python shell to convert text to unicode escapes. But on my first test I found out the charset of the multiplayer server list is VERY limited, similar to the charset we had before multilanguage support was added. "áéíóú" work fine, color codes with § work fine (if anyone reading this needs a quick way to insert color codes, use "\u00A7"), but ß or any non-latin1 unicode chars appear as "?". Setting the client language to pirate or something that uses the alternate font has no effect (Although I noticed §k doesn't work anymore, but that's a different bug I don't care about) Anyway, if you fix this bug, PLEASE expand the charset of motds on the server list to match the chat. It'd be useless otherwise. |
| Comment by Carl Fürstenberg [ 08/Nov/12 ] |
|
Still present in 1.4.4 |