Unicode support.

This commit is contained in:
adustman
2001-12-23 21:37:33 +00:00
parent 6520df9af9
commit 209703c532

View File

@ -41,6 +41,10 @@ def Thing2Str(s, d):
"""Convert something into a string via str()."""
return str(s)
def Unicode2Str(s, d):
"""Convert a unicode object to a string using latin1 encoding."""
return s.encode('latin')
# Python 1.5.2 compatibility hack
if str(0L)[-1]=='L':
def Long2Int(l, d):
@ -106,3 +110,6 @@ conversions = {
FIELD_TYPE.DATE: Date_or_None,
}
if hasattr(types, 'UnicodeType'):
conversions[types.UnicodeType] = Unicode2Str