'ÂTest' :(

Discussion in 'Plugin Development' started by Techy4198, Nov 5, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Techy4198

    im using ChatColor.translateAlternateColorCodes to make it so
    ¬aTest
    would get changed to
    Test
    but instead it shows as
    ÂTest
    how to fix?
     
  2. Offline

    amhokies

    Techy4198
    Why not use some other character?
     
  3. Offline

    xXSniperzzXx_SD

    Techy4198

    Are you using one of these? If so try the other way.
    String.replaceAll("¬", "§");
    Or
    ChatColor.translateAlternateColorCodes("¬", String);

    But ya like amhokies said, why not use someother character
     
  4. Offline

    1Rogue

  5. Offline

    Techy4198

    I don't get it. ¬, § and that A character that internet explorer fails to paste, are all standard ascii characters (they only use one byte) so whats up?
    also xXSniperzzXx_SD umadbro? the first argument of ChatColor.translateAlternateColorCodes MUST be a character. it doesn't accept strings.
     
  6. Offline

    1Rogue


    Change " to '.

    'u mad bro'?


    Minecraft uses UTF-8 as far as I'm aware, and you're probably saving your Yaml files in ASCII.
     
  7. Offline

    Techy4198

    1Rogue why would I change " to ' ? that would give me
    ChatColor.translateAlternateColorCodes('¬', String);
    ...which is what I tried originally. the yaml is saved in 'ANSI as UTF-8' as reported by Notepad++
     
  8. Offline

    1Rogue


    Because ' is a char notation and " is a string notation.

    Considering it's a bunch of encoding shenanigans I would say just use a different character if you don't understand the necessary measures to prevent the issue on every user of your plugin.
     
  9. Offline

    Techy4198

    I chose that character because it is the least-used character on standard qwerty keyboards, I wanted something other than &, and § can't be typed in minecraft. (I will be using commands eventually, to set text in a config file.)

    wait THATS IT! I can just make sure that it gets replaced when SETTING it in the config via command! so I type
    /acs add ¬aHello ¬bWorld¬c!
    and it would save it to the config as
    §aHello §bWorld§c!
    which shouldn't cause any problems when reading it from the config. if it does, then SCREW YOU MOJANG! minecraft needs something which automatically removes strange characters like that which are directly before a § character

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  10. Offline

    1Rogue

    Why not just use "&"? If you use .translateAlternateColorCodes, then it will only replace the correct ones.
     
  11. Offline

    Techy4198

    cos.
     
  12. Offline

    Goblom

    Techy4198 People are trying to help you here and you are pulling comments like umadbro, etc; people wont want to help you anymore if continue to be a 6 year old kid who thinks /r/im14andthisisfunny is actually funny to everyone else. Also, what 1Rogue would solve what you are trying to do.

    On a side note... Techy4198 Why are you using notepad to code plugins, an IDE would be much more helpful and actually give you helpful advice instead of Notepadd++ because you have already been fooled by it once.

    Now, let me repeat what 1Rogue said to do...

    Code:java
    1. String message = "Whatever you want";
    2. message = ChatColor.translateAlternativeColorCodes('&', message);
    3. message = ChatColor.TranslateAlternativeColorCodes('[FONT=Georgia]¬', message);[/FONT]
     
  13. Offline

    1Rogue


    Minus the font tags, ghostrider.
     
  14. Offline

    Goblom

    #BlameBukkitForumsSyntaxFormatting
     
  15. Offline

    Techy4198

    Goblom you tell me that people wont want to help me, well turns out that some don't even know how to understand the problem. I never mentioned that I was coding using notepad++. I am using eclipse. but I use notepad++ for config.yml, plugin.yml, stuff like that. also, why would I want to translate the & character AND the ¬ character?...

    on a final note, I already have an idea about how to fix it,
    so if ur gonna only read a third of the thread and then say i'm acting like a 6 year old, then I honestly don't know why I still bother with this forum.
     
Thread Status:
Not open for further replies.

Share This Page