Opened 14 years ago
Last modified 11 years ago
#6411 closed defect
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2019' in position 475: ordinal not in range(256) — at Initial Version
Reported by: | anonymous | Owned by: | takayama |
---|---|---|---|
Priority: | normal | Component: | SqliteToMySqlScript |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
[root@ptmon 0.11]# python sqlite2mysql -e /my/path/to/trac -p 'mysql://user:password@localhost/trac' Traceback (most recent call last):
File "sqlite2mysql", line 289, in ?
main(getArgs())
File "sqlite2mysql", line 218, in main
rc = tmigration.migrateTable(tname) or rc
File "sqlite2mysql", line 74, in migrateTable
rc = self.default_copy(table)
File "sqlite2mysql", line 95, in default_copy
mycur.execute(insert_into, row)
File "/usr/lib/python2.4/site-packages/trac/db/util.py", line 50, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
File "/usr/lib/python2.4/site-packages/trac/db/util.py", line 50, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
File "build/bdist.linux-i686/egg/MySQLdb/cursors.py", line 158, in execute File "build/bdist.linux-i686/egg/MySQLdb/connections.py", line 265, in literal File "build/bdist.linux-i686/egg/MySQLdb/connections.py", line 203, in unicode_literal
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2019' in position 475: ordinal not in range(256)
Using innodb, and I've done: ALTER DATABASE DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Running show create table <table>; on all the tables shows the DEFAULT CHARSET=utf8 and COLLATE=utf8_bin on everything.
Not exactly sure what I'm doing wrong here.