Using Sequel 3.2, Ruby 1.9.1p0, Postgres 8.3.5 and pg 0.8.0.
How can I get a utf-8 string back from Sequel?

### psql command line
phrogz=# \l
          List of databases
    Name    |   Owner    | Encoding
-----------+------------+----------
  phrogz    | abcde      | UTF8

phrogz=# select title from nodes where name='resume';
  title
--------
  résumé
(1 row)

phrogz=# SHOW client_encoding;
  client_encoding
-----------------
  UTF8
(1 row)

### ruby
# I've also tried 'utf8' and 'unicode' as encoding strings
DB = Sequel.connect( 'postgres://ab...@localhost/ 
phrogz', :encoding=>'UTF8' )
class NodeType < Sequel::Model; end

resume = ::Node[ :name=>'resume' ]
p resume.title.inspect, resume.title.encoding

"\"r\\xC3\\xA9sum\\xC3\\xA9\""
#<Encoding:ASCII-8BIT>


--~--~---------~--~----~------------~-------~--~----~
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