Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with special characters encoding #112

Open
Axer22 opened this issue Jan 17, 2021 · 2 comments
Open

Problem with special characters encoding #112

Axer22 opened this issue Jan 17, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@Axer22
Copy link

Axer22 commented Jan 17, 2021

I have this error when I have any special characters like "ą" or "»" in language.yml file.

[22:01:00] [Server thread/ERROR]: Error occurred while enabling PreciousStones v1.16.1.12 (Is it up to date?)
org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1
	at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:218) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.reader.StreamReader.ensureEnoughData(StreamReader.java:176) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:136) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.scanner.ScannerImpl.scanPlain(ScannerImpl.java:1987) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchPlain(ScannerImpl.java:1044) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:399) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:558) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:235) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:95) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:119) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:150) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:472) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.Yaml.load(Yaml.java:411) ~[patched_1.16.4.jar:git-Purpur-952]
	at net.sacredlabyrinth.Phaed.PreciousStones.managers.LanguageManager.loadFile(LanguageManager.java:61) ~[?:?]
	at net.sacredlabyrinth.Phaed.PreciousStones.managers.LanguageManager.check(LanguageManager.java:44) ~[?:?]
	at net.sacredlabyrinth.Phaed.PreciousStones.managers.LanguageManager.load(LanguageManager.java:35) ~[?:?]
	at net.sacredlabyrinth.Phaed.PreciousStones.managers.LanguageManager.<init>(LanguageManager.java:30) ~[?:?]
	at net.sacredlabyrinth.Phaed.PreciousStones.PreciousStones.onEnable(PreciousStones.java:126) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:501) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:415) ~[patched_1.16.4.jar:git-Purpur-952]
	at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:466) ~[patched_1.16.4.jar:git-Purpur-952]
	at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:249) ~[patched_1.16.4.jar:git-Purpur-952]
	at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:937) ~[patched_1.16.4.jar:git-Purpur-952]
	at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:175) ~[patched_1.16.4.jar:git-Purpur-952]
	at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.nio.charset.MalformedInputException: Input length = 1
	at java.nio.charset.CoderResult.throwException(CoderResult.java:274) ~[?:?]
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:352) ~[?:?]
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188) ~[?:?]
	at java.io.InputStreamReader.read(InputStreamReader.java:181) ~[?:?]
	at org.yaml.snakeyaml.reader.UnicodeReader.read(UnicodeReader.java:125) ~[patched_1.16.4.jar:git-Purpur-952]
	at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:183) ~[patched_1.16.4.jar:git-Purpur-952]
	... 31 more
[22:01:00] [Server thread/INFO]: [PreciousStones] Disabling PreciousStones v1.16.1.12
@xtomyserrax xtomyserrax added the bug Something isn't working label Jan 18, 2021
@Axer22
Copy link
Author

Axer22 commented Apr 23, 2021

When I set options.setAllowUnicode(false); in 74 line of LanguageManager class, the problem dissapeared. There must be something with saveFile() method in that class.

@DiaxManPl
Copy link

Try running server with -Dfile.encoding=UTF-8 option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants