On Sep 11, 3:47 am, Per <[email protected]> wrote: > Thank you for your answer. > > I compiled v. 2.2.3 of sqlite3-ruby from source, and that is the only > sqlite3-ruby code on the machine. > As you can see from the code snippet in my first mail, I generate no > sql myself, only call the built-in sequel method "tables" to get a > list of the tables. This method expands internally to the sql-string > "SELECT * FROM `sqlite_master` WHERE (type = 'table' AND NOT name = > 'sqlite_sequence')" which turns out to be in US-ASCII. The > documentation of the sqlite driver says "In the current implementation > of SQLite, the SQL parser only works with UTF-8 text." > (http://www.sqlite.org/version3.html), so it seems that it is the > responsibility of the calling functions to encode the sql in utf-8. > The small program below omits sequel and uses sqlite3-ruby directly. > It is encoded in utf-8, and the sql passes faultlessly through the > system and returns the list of tables. > ------------------------------------ > # -*- coding: utf-8 -*- > require 'sqlite3' > > db = SQLite3::Database.new( "mm.db" ) > > db.execute("select name from sqlite_master where type='table'") do | > row| > p row > p row[0].encoding.name > end > > db.close > ------------------------------------ > > Thank you for looking into this.
The SQL created by Sequel should be valid US-ASCII and valid UTF-8. You mentioned you had some debugging output, but as you didn't link to it, it's hard for me to judge whether this is a problem with Sequel or somewhere else. From what you've described, I don't think this is a problem with Sequel. Jeremy -- 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.
