MySQL Insert Unicode Problem



Hi,

I'm trying to insert some data from an XML file into MySQL. However,
while importing one of the files, I got this error:

Traceback (most recent call last):
File "wa.py", line 304, in ?
main()
File "wa.py", line 257, in main
curHandler.walkData()
File "wa.py", line 112, in walkData
self.cursor.execute(*sql) #try multi-execute to speed up query.
File "build/bdist.linux-i686/egg/MySQLdb/cursors.py", line 151, in
execute
File "build/bdist.linux-i686/egg/MySQLdb/connections.py", line 247,
in literal
File "build/bdist.linux-i686/egg/MySQLdb/connections.py", line 185,
in unicode_literal
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u20ac'
in position 28: ordinal not in range(256)

What do I need to change to make this work?

Thanks!
Erik

.



Relevant Pages

  • Re: speeding up a file conversion from text file to XML format
    ... to try and improve the importing of files into SQL for old legacy ... The file are submitted to the company by FTP, ... I have written a module to convert this file into an XML file which ... imports to the SQL very quickly. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: speeding up a file conversion from text file to XML format
    ... to try and improve the importing of files into SQL for old legacy ... I have written a module to convert this file into an XML file which ... 4000 data records (data recorded marked for with *** for ... It seems like most of the activity is adding the Transaction XmlElement 4000 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How do I choose a database program?
    ... It depends on your 'user' requirements, and your programming savvy. ... Anything from an XML file to MySql would work, Access is a good program, but ... This is for our basketball league with over 1000 kids ...
    (microsoft.public.access.gettingstarted)
  • Re: ADO/MYSQL
    ... Basically i need to access a mysql database server ... load the data. ... load the information using the structure of the XML file. ... them with ADO... ...
    (borland.public.delphi.database.ado)
  • Re: Editing a huge text file - whats best?
    ... I need to edit a massive .sql file before importing it into MySQL. ...
    (uk.comp.sys.mac)