[erlang-questions] Interactive Shell & unicode

Hynek Vychodil hynek@REDACTED
Fri Sep 24 09:23:08 CEST 2010


On Thu, Sep 23, 2010 at 12:18 PM, Timo Lindemann
<timo.lindemann@REDACTED> wrote:
> Hi,
>
> it seems that the erlang shell is somehow affecting Unicode output in
> the following situation:
>
> -module(test).
> -compile(export_all).
>
> start() ->
>    ets:new(tbl, [named_table, set]),
>    ets:insert(tbl, {1, "ä"}),
>    io:format("~p~n", ets:tab2list(tbl)).
>
> (I don't know if that only happens with ets or dets tables, however.)
>
> If I do
>> erl -run test -run init stop
> then the output is garbled:
>> {1,"ä"}
>
> but if I disable the shell, the output is correct:
>> erl -run test -run init stop -noshell
>> {1,"ä"}
>
> This is Erlang 64-bit on Linux, btw. On my colleague's Powerbook G4,
> both commands produce the output
>> {1,[195,131,194,164]}
>
> What am I doing wrong? Not that it overly impedes my work, but I spent
> hours, yesterday, in trying to produce right string output that
> apparently looked correct to everyone else. Any ideas?
>
> Greetings,
> -T.

There is not "ä" in you test module but "ä". There is not utf8
support for module source code.


-- 
--Hynek (Pichi) Vychodil

Analyze your data in minutes. Share your insights instantly. Thrill
your boss.  Be a data hero!
Try GoodData now for free: www.gooddata.com


More information about the erlang-questions mailing list