Changeset 1913
- Timestamp:
- 02/09/06 08:27:15 (3 years ago)
- Files:
-
- trunk/dabo/db/dCursorMixin.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/db/dCursorMixin.py
r1912 r1913 218 218 row[fld]= unicode(val, self.Encoding) 219 219 except UnicodeDecodeError, e: 220 # Try the main two encodings220 # Try some common encodings: 221 221 ok = False 222 222 for enc in ("utf8", "latin-1"): … … 225 225 row[fld]= unicode(val, enc) 226 226 ok = True 227 break228 227 except UnicodeDecodeError: 229 228 continue 230 if ok: 231 # Should we change self.Encoding at this point? 232 dabo.errorLog.write(_("Incorrect unicode encoding set; using '%s' instead") 229 if ok: 230 # change self.Encoding and log the message 231 self.Encoding = enc 232 dabo.errorLog.write(_("Incorrect unicode encoding set; using '%s' instead") 233 233 % enc) 234 break 234 235 else: 235 236 raise UnicodeDecodeError, e
