Unicode String problem

Buri Arslon buriwoy at gmail.com
Tue Mar 6 11:53:00 EST 2012


Hi Igor,

Actually, utf8 value converted by unicode:characters_to_binary() was
successfully processed by riak. So:

  >Object = riakc_obj:new(<<"snippet">>, undefined,
unicode:characters_to_binary("одамлардан тинглаб хикоя")).
  >riakc_pb_socket:put(Pid, Object)

was accepted.

Thanks,
-- Buriwoy

On Mon, Mar 5, 2012 at 11:25 PM, Igor Karymov <ingham.k at gmail.com> wrote:

> You can't use unicode expression this way from console.
> Try the same expression writen in the erlang module.
>
> 2012/3/5 Steve Vinoski <steve at basho.com>
>
>>
>>
>> On Sun, Mar 4, 2012 at 4:51 PM, Buri Arslon <buriwoy at gmail.com> wrote:
>>
>>> Hi everybody!
>>>
>>> I can't put unicode string to riak. I was following the
>>> riak-erlang-client docs, and this doesn't work:
>>>
>>>   Object = riakc_obj:new(<<"snippet">>, <<"odam">>, <<"Одамлардан
>>> тинглаб хикоя">>).
>>>  ** exception error: bad argument
>>>
>>> I googled but couldn't find anything meaningful about this issue. So,
>>> I'd be very grateful if someone could refer me
>>> to relevant documentation or give me some hints to solve the problem.
>>>
>>
>> Have a look at the Erlang unicode module:
>>
>> http://www.erlang.org/doc/man/unicode.html
>>
>> You probably need to use unicode:characters_to_binary to generate a valid
>> binary for the value you're trying to store in riak.
>>
>> --steve
>>
>> _______________________________________________
>> riak-users mailing list
>> riak-users at lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120306/0afe46fd/attachment.html>


More information about the riak-users mailing list