Good catch, thanks. Actually there is issue when I'm building keys
from response. All of them has #<Encoding:ASCII-8BIT> as the encoding.
This is why it cannot lookup the original key when extracting result
array of the multi get:
1.9.3p194 (main):001:0> keys = ["a", "\uD83D\uDC89"]
=> ["a", "\xED\xA0\xBD\xED\xB2\x89"]
1.9.3p194 (main):002:0> keys.map(&:encoding)
=> [#<Encoding:UTF-8>, #<Encoding:UTF-8>]
1.9.3p194 (main):003:0> Couchbase.bucket.get(keys)
=> [1, nil]
1.9.3p194 (main):004:0> Couchbase.bucket.get(keys, :extended => true)
=> {"a"=>[1, 0, 15824216877734363136],
"\xED\xA0\xBD\xED\xB2\x89"=>[1, 0, 3983500633983090688]}
1.9.3p194 (main):005:0> _.keys.map(&:encoding)
=> [#<Encoding:ASCII-8BIT>, #<Encoding:ASCII-8BIT>]
So I need either remember encoding for each key or force utf-8
everywhere (or Encoding.default_external). What do you think? I like
second case.
Thanks again
--
Sergey Avseyev