<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
</head><body><p>I have set up a chat application using ejabberd(built using erlang) and Pidgin.</p><p>I have witnessed a proceeding where when I print out a message sent by the client to server on ejabberd it comes out as string </p><p>For example,if I send a message as</p><p>aman</p><p>from the pidgin and print it inside the module containing ejabberd hook as <strong>CustomMod.erl </strong>using</p><blockquote><p>Bin=xmpp:get_text(Packet#message.body),<br> Name=binary_to_list(Bin),</p><p>?INFO_MSG("The value of Name is ~p~n",[Name]), </p></blockquote><p>the output comes as "aman"</p><p>but I have a simple erlang module also for login as <strong>login.erl</strong> and it does not implement any ejabberd behavior, but is called from within <strong>CustomMod.erl</strong> when I print this message out in this module it comes enclosed within these << >> but are separated by 0's like</p><p>aman becomes here as <<97,0,109,0,97,0,110,0>></p><p>which on doing binary_to_list(Variable) inside my <strong>login.erl</strong> I get-> [97,0,109,0,97,0,110,0]</p><p>(where Variable is the value enclosed within <<>>)</p><p> Can anyone tell me why is it happening and what is the way to get the value aman in <strong>login.erl</strong> also?</p><p><br></p><p>Regards,</p><p>Abhishek </p></body></html>