Closed alexdev03 closed 1 year ago
Hey, @alexdev03!
I pasted that string into an example configuration and saved it; the output looks correct to me:
What program did you use to open that file? Perhaps it doesn't properly handle UTF-8 or you saved the source file (i.e. the .java
file) using a different encoding (perhaps windows-1252
in case you are on Windows)?
The code is run on Linux, on a paper server. I opened it with visual studio code. Also in game I get the same same string as vs code.
As I cannot reproduce this problem (as shown in my screennshots above), I assume that your .java
files are saved with some encoding other than UTF-8
. Please make sure that (a) your editor uses UTF-8
when saving your .java
files, (b) you call javac
(the Java compiler) with the -encoding
option set to UTF-8
, and (c) that you start your server/the JVM with -Dfile.encoding
also set to UTF-8
.
Intellij has as default encoding type UTF-8, I checked and i'ts correct. I tried by adding -Dfile.encoding
as starting flag but the issue persists. I also checked the editor and vs code uses UTF-8 to open that file. I tried by opening that java file with vs code and the strings are correct.
I uploaded the classes that I use to create that file. Thanks
Hm, the contents of the file look fine for me and still don't cause any issues on my system. What happens if you recomile your plugin with the things I said and also regenerate the config file (i.e. delete the old one) with the options I listed on your server? What is the output of java.nio.charset.Charset.defaultCharset()
on your server?
I fixed that, I use gradle as library and build system. And the default encoding wasn't UTF-8. I added compileJava.options.encoding = 'UTF-8'
Thanks for the support
I put this string ( in a record and when I save in the yaml file I get (
&7➥ &7Complete the previus task
) inside a List&7➥ &7Complete the previus task
) I tried with the default one and also with bukkit.