Only English Characters

Discussion in 'Plugin Requests' started by EgeTurker, Jul 11, 2019.

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

    EgeTurker

    I want to allow only english characters on chat. Thank you
     
  2. Offline

    timtower Administrator Administrator Moderator

    @EgeTurker Is this a request or do you need help making it?
     
  3. Offline

    EgeTurker

    Request
     
  4. Offline

    timtower Administrator Administrator Moderator

    In that case:
    Moved to plugin requests.
     
  5. Offline

    KarimAKL

    @EgeTurker When you say "english characters", what exactly do you mean? Do you have a list of the characters?
     
  6. Offline

    EgeTurker

    Only all letters on english alphabet
     
  7. Offline

    KarimAKL

    @EgeTurker Minecraft version? Plugin name? Any permissions?
     
  8. Offline

    Tango_

    If you're making this, you might find this useful:

    Code:
        private boolean isEnglish(String text) {
           
            CharsetEncoder asciiEncoder = Charset.forName("US-ASCII").newEncoder();
            CharsetEncoder isoEncoder = Charset.forName("ISO-8859-1").newEncoder();
           
            return  asciiEncoder.canEncode(text) || isoEncoder.canEncode(text);
        }
     
    KarimAKL likes this.
  9. Offline

    KarimAKL

    @Tango_ I was thinking of using regex, i'll look more into that, thanks. :p
    EDIT: @EgeTurker, would you like to allow special characters? (;,:._-*'^¨~`´|?+<>\\/=()[]{}&%¤#\"!@£$€§½ (etc.)) Because it seems like not all of those are allowed by ASCII/ISO. (and i don't know much about chars, so i'm not sure if there's any charset that allows those but still only allows english letters)
     
    Last edited by a moderator: Jul 12, 2019
Thread Status:
Not open for further replies.

Share This Page