I'm trying to save some Japanese data encoded in UTF-8 into a Sqlite3
database. When I retrieve a record,
I find that the data has been re-encoded to ASCII 8-BIT. This wouldn't
be a problem but when I update
a field with new UTF-8 data and try to save it, Ruby raises an error:
Encoding::CompatibilityError: incompatible character encodings: UTF-8
and ASCII-8BIT
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
dataset/sql.rb:754:in `join'
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
dataset/sql.rb:754:in `update_sql'
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
dataset.rb:255:in `update'
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
model/base.rb:814:in `_save'
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
model/base.rb:687:in `block in save'
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
adapters/sqlite.rb:99:in `block (2 levels) in transaction'
from /usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.4/lib/
sqlite3/database.rb:564:in `transaction'
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
adapters/sqlite.rb:99:in `block in transaction'
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
connection_pool.rb:110:in `hold'
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
database.rb:472:in `synchronize'
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
adapters/sqlite.rb:94:in `transaction'
from /usr/local/lib/ruby/gems/1.9.1/gems/sequel-2.12.0/lib/sequel/
model/base.rb:687:in `save'
Is there a way to tell Sequel to use a specific encoding when storing
a record? Or a option to set which encoding
to use when creating the table?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---