def _to_unicode(var):
 if isinstance(var, str):
  try:
   var = unicode(var)
  except Exception:
   try:
    var = unicode(var, 'utf-8')
   except Exception:
    try:
     var = unicode(var, 'latin-1')
    except Exception:
     try:
      var = unicode(var, sickbeard.SYS_ENCODING)
     except Exception:
      try:
       var = unicode(var, detect(var).get('encoding'))
      except Exception:
       var = unicode(var, sickbeard.SYS_ENCODING, 'replace')
 return var

def _to_unicode ( var ) : if isinstance ( var , str ) : try : var = unicode ( var ) except Exception : try : var = unicode ( var , 'utf-8' ) except Exception : try : var = unicode ( var , 'latin-1' ) except Exception : try : var = unicode ( var , sickbeard . SYS_ENCODING ) except Exception : try : var = unicode ( var , detect ( var ) . get ( 'encoding' ) ) except Exception : var = unicode ( var , sickbeard . SYS_ENCODING , 'replace' ) return var
provides the unicode string for the given ascii bytes .