On Sep 11, 11:32 am, Per <[email protected]> wrote:
> Maybe this is a question of some encoding switch that I have not set,
> but I do not understand how I can influence the coding of the sql that
> the 'tables' method
> generates. The sql is built internally in sequel/adapters/shared/
> sqlite.rb and results in an US-ASCII sql string that I have no direct
> control over.
> The sql is subsequently executed by the _execute method in sequel/
> adapters/sqlite.rb. I have added a couple of lines to the beginning of
> this method that expressly changes to coding to utf-8, and everything
> works nicely with this hack:
>
> def _execute(type, sql, opts, &block)
>    begin
>       STDERR.puts "in sequel/adapters/sqlite.rb, _execute: " +
> sql.to_s + " " + sql.encoding.name
>       csql = sql
>       sql = csql.encode("utf-8")
>       STDERR.puts "in sequel/adapters/sqlite.rb, _execute: " +
> sql.to_s + " " + sql.encoding.name
> ...
>
> This is the debugging output:
> in sequel/adapters/sqlite.rb, _execute: SELECT * FROM `sqlite_master`
> WHERE (type = 'table' AND NOT name = 'sqlite_sequence') US-ASCII
> in sequel/adapters/sqlite.rb, _execute: SELECT * FROM `sqlite_master`
> WHERE (type = 'table' AND NOT name = 'sqlite_sequence') UTF-8
>
> Again, thank you for your patience.

That's probably a bug in the database driver (sqlite3-ruby), and
possibly specific to Windows.  The SQL string is valid US-ASCII and
valid UTF-8, so the .encode('utf-8') shouldn't actually change the
bytes in the string.  I suggest you report it to the sqlite3-ruby
project.  If they determine that it's a problem with Sequel and not
sqlite3-ruby, I'll work with them to get it resolved.

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.

Reply via email to