[erlang-questions] ejabberd translate crash

nickel chen nickelchen@REDACTED
Thu Apr 10 09:24:08 CEST 2014


 Hi all, I'm new to erlang and I'm learning the code of ejabberd 13.12, I already have ejabberd installed, then start it with

sudo ejabberdctl start

There is a crash message in /var/log/ejabberd.log

2014-04-10 14:37:56.520 [info] <0.7.0> Application ejabberd exited with reason: bad argument in call to erlang:iolist_to_binary([916,953,945,956,972,961,966,969,963,951,32,928,961,972,963,946,945,963,951,962]) in translate:'-load_file/2-fun-2-'/3 line 91

i added some debug info to the source code ` translate.erl`  and recompile ejabberd. then start it again, below is the debug message:


2014-04-10 14:37:56.517 [info] <0.38.0>@translate:load_file:87 File is: <<"//lib/ejabberd/priv/msgs/el.msg">>, Orig is:"Access Configuration", Trans is: [916,953,945,956,972,961,966,969,963,951,32,928,961,972,963,946,945,963,951,962]

well it's clear that there are unicode characters in I18N translation , when passed to the erlang:iolist_to_binary/1, it crashed with badarg, because iolist only accepts byte( ) binary( ) and other iolist( )

9> erlang:iolist_to_binary([256]).
** exception error: bad argument
     in function  iolist_to_binary/1
        called as iolist_to_binary([256])
10> erlang:iolist_to_binary([255]).
<<"ÿ">>
11> 

My question is simple, how to get around with this problem and get ejabberd launched?

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140410/274962a6/attachment.htm>


More information about the erlang-questions mailing list