Erlang - Eccentricity with accented characters and string literal

Posted by erevfall on Stack Overflow See other posts from Stack Overflow or by erevfall
Published on 2010-06-10T15:33:10Z Indexed on 2010/06/10 15:52 UTC
Read the original article Hit count: 235

Filed under:
|
|

Hey, I am trying to implement a function to differentiate between french vowels and consonnants. It should be trivial, let's see what I wrote down :

-define(vowels,"aeiouyàâéèêëôù").

is_vowel(Char) -> C = string:to_lower(Char),
                  lists:member(C,?vowels).

It's pretty simple, but it behaves incorrectly :

2> char:is_vowel($â).
false

While the interpreted version works well :

3> C = string:to_lower($â), lists:member(C,"aeiouyàâéèêëôù").
true

What's going on ?

© Stack Overflow or respective owner

Related posts about erlang

Related posts about accents