[ejabberd] How to get regular C-style string from jlib
monkeyfdude at gmail.com
Mon Mar 2 18:35:41 MSK 2015
I mean I kept it a binary. I needed to convert it binary_to_list just
before sending it over the wire. I do not store as String in Mnesia.
I assume I can do Mnesia queries on binary data without any issues,
specifically if I have binary as primary key.
On Mon, Mar 2, 2015 at 12:43 AM, Mickaël Rémond <mremond at process-one.net>
> 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">>).
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ejabberd