it's slightly more sane to only do this when you have a unicode object. Something like:

    if isinstance(value, unicode):
        value = value.encode('...')