<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi,<div><br></div><div>I’m not really familiar with ejabberd in particular, but I can think of two possible ways to fix your problem:</div><div><ul class="MailOutline"><li>change the iolist_to_binary call to uncidoe:characters_to_binary, which will take care of utf8 encoding the unicode code points</li><li>change the translation file (el.msg) to contain the translations as binaries instead of strings (<<“…”/utf8>>)</li></ul></div><div><br></div><div>I’d prefer the first solution, btw.</div><div><br></div><div>Regards,</div><div>Daniel</div><div><br><div><div>On 2014 Apr 11, at 8:41 , nickel chen <<a href="mailto:nickelchen@yahoo.com">nickelchen@yahoo.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"><div><span>anyone information,  please? i'm stucked at this problem.</span></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> nickel chen <<a href="mailto:nickelchen@yahoo.com">nickelchen@yahoo.com</a>> 于 2014年4月10日, 星期四, 3:24 下午 写道:<br> </font> </div>  <div class="y_msg_container"><div id="yiv3827799901"><div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"><div> 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</div><div><br></div><div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">sudo ejabberdctl start</div><div><br></div><div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">There is a crash message in /var/log/ejabberd.log</div><div>







</div><div class="yiv3827799901p1"><br></div><div class="yiv3827799901p1" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">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</div><div class="yiv3827799901p1" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div class="yiv3827799901p1" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size:12pt;background-color:transparent;">i added some debug info to the source code ` translate.erl`  and recompile ejabberd. then start it again, below is the debug message:</span><br></div><div class="yiv3827799901p1" style="font-size: 12pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size:12pt;"><br></span></div><div class="yiv3827799901p1" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size:12pt;">







</span></div><div class="yiv3827799901p1">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]</div><div class="yiv3827799901p1"><br></div><div class="yiv3827799901p1" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">well it's clear that there are unicode characters in I18N translation , when passed to <span style="font-size:12pt;">the </span><span style="font-size:12pt;">erlang:iolist_to_binary/1, it crashed with badarg, because iolist only accepts byte( ) binary( ) and other iolist( )</span></div><div class="yiv3827799901p1" style="font-size: 12pt;"><span style="font-size:12pt;"><br></span></div><div class="yiv3827799901p1">9> erlang:iolist_to_binary([256]).</div><div class="yiv3827799901p1">** exception error: bad argument</div><div class="yiv3827799901p1">     in function  iolist_to_binary/1</div><div class="yiv3827799901p1">        called as iolist_to_binary([256])</div><div class="yiv3827799901p1">10> erlang:iolist_to_binary([255]).</div><div class="yiv3827799901p1"><<"ÿ">></div><div class="yiv3827799901p1" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size:12pt;">













</span></div><div class="yiv3827799901p1">11> </div><div class="yiv3827799901p1" style="font-size: 12pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size:12pt;"><br></span></div><div class="yiv3827799901p1" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">My question is simple, how to get around with this problem and get ejabberd launched?</div><div class="yiv3827799901p1" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div class="yiv3827799901p1" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">Thanks in advance!</div></div></div><br><br></div>  </div> </div>  </div> </div></div>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br></div></body></html>