Changeset 2862 for pykota

Show
Ignore:
Timestamp:
04/10/06 21:34:56 (19 years ago)
Author:
jerome
Message:

Fixed an UTF-8 encoding error...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/mysqlstorage.py

    r2830 r2862  
    146146            return field 
    147147        elif field is not None : 
    148             return (self.database.string_literal(field)).encode("UTF-8") 
     148            newfield = self.database.string_literal(field) 
     149            try : 
     150                return newfield.encode("UTF-8") 
     151            except UnicodeDecodeError :     
     152                return newfield 
    149153        else : 
    150154            self.tool.logdebug("WARNING: field has no type, returning NULL")