[ejabberd] How to get regular C-style string from jlib

Gaurav Jain monkeyfdude at gmail.com
Mon Mar 2 13:22:03 MSK 2015


Yeah. I did that after going through Erlang docs.

Thank you very much!

On Mon, Mar 2, 2015 at 12:43 AM, Mickaël Rémond <mremond at process-one.net>
wrote:

> Hello,
>
> Please, note that as there is no Erlang string, both representation are
> valid "string".
>
> On  2 Mar 2015, monkeyfdude at gmail.com wrote:
>
> > Hi,
> >
> > All the xml elements returns value is format like
> >
> > <<"1234567890123111">>
>
> This is a binary.
>
> > How can I get or convert this value to
> >
> > "1234567890123111"
>
> This is a list. You can convert it to list:
>
> Eshell V6.3  (abort with ^G)
> 1> binary_to_list(<<"1234567890123111">>).
> "1234567890123111"
>
> Please, note that if you can, keep binary as they consume less
> memory. We switched in 2013 from list representation to binary as a huge
> effort to optimize ejabberd memory consumption.
>
> Best regards,
>
> --
> Mickaël Rémond
>  http://www.process-one.net/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20150302/e5e138bd/attachment.html>


More information about the ejabberd mailing list