This is certainly due to the fact that your terminal is UTF-8 encoded, i.e. the strings you input are UTF-8 encoded. However the functions from the String
module (at least in the official stdlib) act only on latin1 (ISO-8859-1) encoded strings. So you can't expect them to work on UTF-8 encoded strings.
This should be easy to check do a:
String.length "é"
if this is not 1 but 2 you are inputing UTF-8 encoded strings.