def makeUnicode(text):
 if isinstance(text, str):
  text = unicode(text, 'ISO-8859-1')
 elif (not isinstance(text, unicode)):
  try:
   text = unicode(text)
  except UnicodeError:
   try:
    text = str(text)
   except Exception:
    text = repr(text)
   return makeUnicode(text)
 text = regex_control_code.sub((lambda regs: controlchars[ord(regs.group(1))]), text)
 text = re.sub('\\\\x0([0-7])(?=[^0-7]|$)', '\\\\\\1', text)
 return text

def makeUnicode ( text ) : if isinstance ( text , str ) : text = unicode ( text , 'ISO-8859-1' ) elif ( not isinstance ( text , unicode ) ) : try : text = unicode ( text ) except UnicodeError : try : text = str ( text ) except Exception : text = repr ( text ) return makeUnicode ( text ) text = regex_control_code . sub ( ( lambda regs : controlchars [ ord ( regs . group ( 1 ) ) ] ) , text ) text = re . sub ( '\\\\x0([0-7])(?=[^0-7]|$)' , '\\\\\\1' , text ) return text
convert text to printable unicode string .