[erlang-questions] utf8 in source files

Vlad Dumitrescu vladdu55@REDACTED
Tue Nov 9 08:19:46 CET 2010


Hi,

On Tue, Nov 9, 2010 at 07:34, Allan Wegan <allanwegan@REDACTED> wrote:
>> From what I saw, the usage is in regular literal strings and in
>> comments.
>
> Standard list based string literals of course do not work. Each byte of
> a UTF-8 encoded string becomes a separate integer in the resulting list.
>
> Simply using UTF-8 without changing the parsing process does only work
> with binary string literals. For binaries it does not matter whether the
> parser treats code points encoded in multiple bytes as a whole or as
> separate bytes.

Yes and no. If one only uses the string as a message to be output on
the teerminal and the terminal supports utf-8, then it works. Erlang
will see a weird-looking string, but doesn't care. The terminal
recognizes utf-8 and prints the right character.

regards,
Vlad


More information about the erlang-questions mailing list