Fun with Unicode

Sean Cribbs sean at basho.com
Mon Feb 4 09:45:11 EST 2013


The issue is not present in Ruby (at least on 1.9 or newer, 1.8 can be
sketchy). Instead of having different types for unicode and ascii
strings, they are all just String. The difference is that they have an
encoding attached and can automatically be transcoded to a different
format.

Furthermore, the Ruby client uses MultiJson[1], which allows one to
select which codec library to use, either for performance or
compatibility reasons.

[1] https://github.com/intridea/multi_json

On Mon, Feb 4, 2013 at 4:43 AM, Anton <theatilla at gmail.com> wrote:
> After looking a bit more into this, I am not sure changes in just one
> client are warranted. Apparently most of the JSON encoders muck about
> and force everything into ASCII by default, for legacy reasons. In
> fact, Ruby didn't seem to have a way to configure the encoder in any
> other way, according to http://flori.github.com/json/, although the
> documentation in the actual github repo now states otherwise. And PHP
> added that flag to the JSON encoder only in the last version.
>
> As far as Python goes, there is an easy way to change the default
> encoder, using set_encoder, so Adam's solution will do the job and
> explicit is probably better than implicit, as usual.
>
> Maybe an article in the documentation explaining all this is a better idea?



-- 
Sean Cribbs <sean at basho.com>
Software Engineer
Basho Technologies, Inc.
http://basho.com/




More information about the riak-users mailing list