How to read non-alphanumeric characters from Yaml

Discussion in 'Plugin Development' started by william9518, Jan 16, 2013.

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

    william9518

    so i did getConfig().getString("prefix");
    and the prefix: in the config says
    prefix: &a<Console>
    NOTE: i have already made a color code method so its not that.
    in stacktrace, this happen:
    Blablabla
    must be alphanumeric character! Non detected!

    at &a<Console>
    ^
    at &a<Console>
    ^
    at &a<Console>
    ^

    Help, I need to read those! How does say essentials read it then?!
     
  2. Offline

    tommycake50

    read as an object and cast to string?
     
  3. Offline

    william9518

    tried, same exception
     
  4. Offline

    Sagacious_Zed Bukkit Docs

    Certain special characters in yaml must be escaped before they can be used in a string.
     
  5. Offline

    RainoBoy97

    Put single ' around it
     
  6. Offline

    william9518

    How i do dahht

    Then it read as 'bla'. Do i need to make a method to trim it?

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

    RainoBoy97

  8. Offline

    tommycake50

    so say it is & ecaping & would be \&
     
  9. Offline

    william9518

    Do i have to make a method for reading that!??
     
  10. Offline

    tommycake50

    no just read it normally its fine it just escapes the characters
     
  11. Offline

    ZachBora

    Just make it a string.

    prefix: '&a<Console>'
     
  12. Offline

    william9518

    k thx it worked
     
  13. Offline

    ZachBora

    no problem. If you have a string with ', double it.
     
  14. Offline

    william9518

    thx. The plugin associated with htis problem if u want to know is in my sig.
    or here:
    dev.bukkit.org/server-mods/consoleplus
    Work on something together? coding alone gets boring sometimes... :p
     
  15. Offline

    ZachBora

    Sorry, PlotMe takes all my time.
     
  16. Offline

    william9518

    I see it right now. Can I be added to the list of devs?
     
  17. Offline

    ZachBora

    If you follow the application instructions we'll think about it.
     
Thread Status:
Not open for further replies.

Share This Page