My files are not saved in UTF-8
Answered
Hello, I'm a Java developer and today I wanted to make a plugin (with the Spigot API), but I have a problem, in my project I have a file ("config.yml") with several arguments in UTF-8 (example: "§" or "─"), when I built my project I had problems because of the UTF-8 that doesn't work! I searched in the source file of my project and my file ("config.yml") was not encoded in UTF-8 but with nothing (according to Notepad++) but Intellij tells me that it is well encoded in UTF-8! I already managed to make another plugin with the file ("config.yml") encoded in UTF-8 and I had no problem but I can't reproduce this case! What can I do ?
(ps: start.bat is my plugin executor for spigot)




Please sign in to leave a comment.
> when I built my project I had problems because of the UTF-8
May you show what error occurs? Why do you think that encoding is the reason?
> was not encoded in UTF-8 but with nothing
The fact that notepad did not detect encoding automatically does not mean that the file is encoded with nothing. You may try to choose "With BOM" option for UTF-8 encoding (https://i.imgur.com/E0d2Q4i.png), so it will be explicitly defined in the file's header that the file is encoded in UTF-8. Does it help to detect encoding in Notepad?
I finally succeeded, the problem was the encoding in UTF-8, to make it work I restarted my computer and I recreated the file and it worked without any problem! And why UTF-8 encoding was my problem, it's because the text I had to display in the game was special characters instead of accents. Thank you for your response!