def any2utf8(text, errors='strict', encoding='utf8'):
 if isinstance(text, unicode):
  return text.encode('utf8')
 return unicode(text, encoding, errors=errors).encode('utf8')

def any2utf8 ( text , errors = 'strict' , encoding = 'utf8' ) : if isinstance ( text , unicode ) : return text . encode ( 'utf8' ) return unicode ( text , encoding , errors = errors ) . encode ( 'utf8' )
convert a string .