unicode and strings
lists at debpro.webcom.dk
Wed Nov 3 00:17:30 CET 2004
I'm trying to learn Python via Marks Feedparser.
If the character encoding can not be determined, Universal Feed Parser
sets the bozo bit to 1 and sets bozo_exception to
feedparser.CharacterEncodingUnknown. In this case, parsed values will be
strings, not Unicode strings.
I guess this means that all data will be unicode, and to put in a
database I could use my mycode function. Correct?
if isinstance(value, unicode):
value = value.encode('utf-8')
What do I do about data that is a string?
More information about the Python-list