comparison MySQLdb/converters.py @ 59:5db99d9be0fb MySQLdb

Fix #2663436: Character fields with a binary character set should be returned as str, else unicode.
author adustman
date Thu, 05 Mar 2009 02:40:50 +0000
parents 9ea2b0e9302e
children 2d6a35051f64
comparison
equal deleted inserted replaced
58:6732437eb2ac 59:5db99d9be0fb
178 ] 178 ]
179 179
180 def character_sql_to_python_plugin(cursor, field): 180 def character_sql_to_python_plugin(cursor, field):
181 if field.type not in character_types: 181 if field.type not in character_types:
182 return None 182 return None
183 if field.flags & FLAG.BINARY: 183 if field.charsetnr == 63:
184 return str 184 return str
185 185
186 charset = cursor.connection.character_set_name() 186 charset = cursor.connection.character_set_name()
187 def char_to_unicode(s): 187 def char_to_unicode(s):
188 return s.decode(charset) 188 return s.decode(charset)