You can put all valid characters in a string and then search for the string sequentially.
gsm = "@£$¥èéùìòÇØøÅåΔ_ΦΓΛΩΠΨΣΘΞ^{}\[~]|€ÆæßÉ!\"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà"; var letter = 'a'; var letterInAlfabet = gsm.indexOf(letter) !== -1;
Make sure you encode your encodings correctly, i.e. save the Javascript file as UTF8 and indicate that it is UTF8 for the browser .
source share