Hello,
I'm running into a problem while importing data from a mysql server to
a postgres server using sequel.
The server encoding is latin1 on the mysql server, and utf8 on the
postgresql server, and I use the following connections:
Sequel.connect('mysql://[email protected]/pcom', :encoding => 'utf8')
Sequel.connect('postgres://pointscommu...@localhost/
pointscommuns2_development', :encoding => 'UTF8')
I checked and client encodings are correctly defined either side.
Mysql returns utf-8 encoded strings. The problem is on the potsgres
adapter, which actually escapes the string with \XXX characters in the
SQL INSERT statement. For instance:
INSERT INTO comments (title, body) VALUES ('Le résumé du film', 'Le r
\303\251sum\303\251 du film');
Strange enough, it only happens for TEXT fields, VARCHAR fields are
behaving correctly.
Also note that loading data from mysql with sequel and inserting it
with an ActiveRecord doesn't produce this bug, so I suppose the bug is
not in pg.
Any idea?
Used software:
Ubuntu 10.10
MySQL 5.1.49
PostgreSQL 8.4.5
Ruby Enterprise Edition 1.8.7 / Ruby 1.9.2
Sequel 3.17.0
pg 0.9.0
Rails 3.0.1
--
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.