Consider this snippet:
Eshell V5.9.1 (abort with ^G)
1> A="Pamet".
"Pamet"
2> A1="Paměť".
[80,97,109,283,357]
("Paměť" is the Czech word for "memory". I chose it because it contains two characters that Erlang thinks are "unprintable".) IIRC Erlang, having originated in Sweden, assumes that if a character doesn't exist in Latin 1, it is unprintable. Hence, even though I'm running the shell on a modern Linux box where everything is UTF-8, it outputs a list of integers instead of "Paměť".
My question: how to write a UTF-8 string to the screen so it appears as a string of characters, and not a list of integers?
Here you'd find some explanations on what's going on and how to do it: http://www.erlang.org/doc/apps/stdlib/unicode_usage.html
Basically, you can check that using something like this:
1> lists:keyfind(encoding, 1, io:getopts()).
{encoding, unicode}
2> io:format("~ts~n",["Paměť"]).
Paměť
ok
3>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With