Special Characters... the war! XD

Discussion in 'Plugin Development' started by Goty_Metal, Feb 21, 2013.

Thread Status:
Not open for further replies.
  1. Well me and the players using my plugins like "Death Messages" are puzzled, cause in the 1.4.6 of bukkit was possible to add special characters in yaml files like 'áéíóúñ...' etc, and from the 1.4.7 in advance we all get the typical error "unexpected character "x" in position x".

    I've been reading about encoding the config files to prevent errors in Linux/Windows, cause windows usually works well with all encodings but not Linux, so i encoded the files in UTF-8, ANSI and ISO-8859-1 (which is compatible with both SOs) but nothing worked, i hope anyone knows how to solve this, thanks!
     
  2. Offline

    kreashenz

  3. Put special characters as i said before in yaml files (strings) like 'á é í ó ú' instead of 'a e i o u', french and spanish people can't use the strings well cause this, bukkit launches "unexpected character on position bla bla" no matter how i encode the files, ansi, utf-8...

    Tme problem is, before 1.4 worked, but when bukkit updated to 1.4.7 stop working.... if it's no fix for it maybe i could add variables to replace like "aa -> á" or "%e -> é"
     
  4. Offline

    Anubis3467

    Did you found how to do this?
     
  5. Offline

    ZodiacTheories

  6. Nope still lost... dunno how to :(
     
  7. Offline

    DinosParkour

  8. Offline

    AoH_Ruthless

    DinosParkour
    While a bump is usually not warranted, the thread still isn't solved I guess and most people bump because they have a similar issue.

    Goty_Metal
    Are you sure you are saving as UTF-8 encoding properly?
     
  9. Offline

    Anubis3467

    I have the similar issue. I found that I need to download some kind of "Bukkit Translation" but I don't know You guys can help me?
     
  10. Offline

    JBoss925

    Anubis3467
    Let's say I want it so say "Soy español."

    All I must do is use replacement characters.

    For ease we will let the users input the string with the "invalid characters" and we will use an encode method like this:
    Code:java
    1. public String encode(String invalidString){
    2. return invalidString.replace("ñ", "&n");
    3. }


    That method is where we create "special characters" or character(s) meant to represent another character that's not supported.

    Now, when we want to retrieve the string, we use a decode method, like so:

    Code:java
    1. public String decode(String encodedString){
    2. return encodedString.replace("&n", "ñ");
    3. }


    Now we have our desired string and an easy way to store it.
     
  11. Offline

    Anubis3467


    Thanks... But I don't know how to code T_T The problem is when some Items have Lore or Names with those Characters when the Server reloads (Or just Stop and Open again) they have like "MuriÂo" inteads of a normal "ó" and in the lang files of some plugins etc.... like the Heads one.

    Oh And sorry for bad English Grammar :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  12. Offline

    JBoss925

    Sadly there's no way around that other than changing the source code and when spigot did it bukkit was not happy :D
     
  13. Offline

    Anubis3467


    Thanks :)
     
  14. Offline

    Shevchik

    Set your JVM encoding to UTF-8.
     
  15. Offline

    Anubis3467

    ¿Where?
     
  16. Offline

    Anubis3467

Thread Status:
Not open for further replies.

Share This Page