SQLite in Ruby: Prepared statement cutting UTF-8 input
问题 I'm having an issue where variables are cut when they contain special characters. This is a complete reproducable program that should run in irb: require 'sqlite3' db = SQLite3::Database.new ":memory:" db.query "CREATE TABLE test (id INTEGER PRIMARY KEY, key TEXT, value TEXT)" db.query "INSERT INTO test(key, value) VALUES(?, ?)", "foo", "baræøå" db.get_first_value "SELECT value FROM test" This yields: => bar If I have understood it correctly, the database should default to UTF-8, and indeed,