Solved UTF-8 Encoding?

Discussion in 'Spigot Plugin Development' started by Banbeucmas, May 26, 2016.

  1. This problem is pretty weird, so apparently i was trying to localize my plugin so it can use different language, so i store the language into language_%A Country Code%.properties

    The plugins works perfect except one thing, my country properties file which is Language_vi_VN has some problem for sending message, here is it
    http://hastebin.com/tumorizeju.ini

    So I have tried to do the project encoding (IntelliJ) into
    IDE Encoding: ISO-8859-1 and UTF-8 (I tried)
    Project Encoding: same with above
    Properties Encoding: same with above


    The properties file has encoded flawlessly without any issue, except when i trying to send out those message i got this https://gyazo.com/c2170fcc6345b5600a86045cd16dd8c9

    Now just to know this message also display on Console as well but strange I even put DFile Encoding = UTF-8 flag into my jar

    Also don't say anything about my console, i configured it to work with UTF-8
     
  2. You're going to have to use your own config file reader. The one built into Bukkit will not handle encoding correctly. I reported this like 4 years ago and Bukkit team simply replied with "working as intended". So yeah.

    Other option is to escape all the special characters with their appropriate Unicode escape sequence (\u00a7 etc) in the file manually.
     
  3. Is there a way to do it since I am using this
    https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html
     
  4. I would tag the one who said i can use that
    @stoneminer02
     
  5. You'd need to add some kind of "replacement" for them.
    E.g. I'd add %AA% for Å, %aa% for å, %o% for ø, %O% for Ø, etc.
    Just do that for your alphabet.
     
  6. wat.


    That's a horrible idea... If someone is going to take the time to swap out special characters for something else, might as well be the proper escaped unicode...

    E.g. \u00c5 for Å, \u00e5 for å, \u00f8 for ø, and \u00d8 for Ø.

    These escaped strings will work as expected in Java.
     
    • Agree Agree x 1
  7. Is there a website to transfef them right away to escaped unicode? Else, this is going to be tough T_T
     
  8. Never used that.. xD

    https://r12a.github.io/apps/conversion/