Details
Description
I can't seem to find a way to save UTF-8 data into Cassandra.
I'm using the cassandra gem 0.11.1 (https://github.com/fauna/cassandra/) which in turn uses thrift_client (0.6.2), which in turns uses the thrift library (0.6.0).
As an example, the following code[1]
cassandra.insert(:Cache, "123", {"unicode string" => "รค"})
will raise an exception:
Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8
The stacktrace points to `thrift-0.6.0/lib/thrift/transport/framed_transport.rb:58`. What seems to be happening is that `@wbuf` is encoded as ASCII-8BIT, while `buf` is encoded as UTF-8, which causes the concatenation operation (<<) to fail with the exception above.
This issue might be connected to https://issues.apache.org/jira/browse/THRIFT-1023.
[1] Of course, this assumes a "cassandra" object created using the cassandra gem and a schema inizialized with a column family called "Cache"
Attachments
Issue Links
- is related to
-
THRIFT-1023 Thrift encoding (UTF-8) issue with Ruby 1.9.2
- Closed