def text_clean(text):
 retval = text
 retval = retval.replace('\xe2\x80\x98', "'")
 retval = retval.replace('\xe2\x80\x99', "'")
 retval = retval.replace('\xe2', '')
 return retval

def text_clean ( text ) : retval = text retval = retval . replace ( '\xe2\x80\x98' , "'" ) retval = retval . replace ( '\xe2\x80\x99' , "'" ) retval = retval . replace ( '\xe2' , '' ) return retval
this always seems like such a hack .