Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved print accented letters

Comments in 'Plugin Development' started by Kripto, Sep 16, 2015.

  1. Kripto
    Offline

    Kripto New Member

    Joined:
    Mar 2, 2014
    Posts:
    15
    Minecraft User:
    Kripto96
    How can accented letter be used? I tried to use them as normal characters (like à è î) but they aren't printed. I also tried to use the hex character (like \xE0) but they're printed as a normal string.

    Is there a way to print them? Do I have to change something in the setting?

    EDIT:

    solved using html_entity_decode() on the strings (written as HTML entities)

    This should work:
    PHP:
    $string 'cjalâ';

    $html htmlentities($stringENT_NOQUOTES); //cjalâ

    $finalstring html_entity_decode($htmlENT_NOQUOTES);
    Last edited: Sep 17, 2015
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Type them directly. How are you printing them? If your encoding is UTF-8, it should be all right.
  3. Kripto
    Offline

    Kripto New Member

    Joined:
    Mar 2, 2014
    Posts:
    15
    Minecraft User:
    Kripto96
    Where can I check or change my server encoding?

    I'm printing them using the Player::sendMessage() function
    Minecrafter9203 likes this.
  4. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    Tip: Look into your IDE settings
    Minecrafter9203 and PEMapModder like this.
  5. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    I have noticed that MCPE no longer render special ASCII characters through UTF-8 values, since 0.11 release...

    IDE has nothing to do with this...
  6. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Tip: IDE has nothing to do with accented characters.
  7. Kripto
    Offline

    Kripto New Member

    Joined:
    Mar 2, 2014
    Posts:
    15
    Minecraft User:
    Kripto96
    solved using some html tricks, as I wrote in the main post
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    They do. PHP does not convert special characters; so the server sends data from the source as-is. If the characters come from your config file, check your config file's encoding. If they come from string literals in your plugin, check your plugin's encoding, i.e. your IDE's encoding.

    Do not reply to a thread unless you know what you are talking about.
    CrazedMiner likes this.

Share This Page

Advertisement