def console_decode(string, encoding=CONSOLE_ENCODING, force=False):
 if (is_unicode(string) and (not (IRONPYTHON and force))):
  return string
 encoding = {'CONSOLE': CONSOLE_ENCODING, 'SYSTEM': SYSTEM_ENCODING}.get(encoding.upper(), encoding)
 try:
  return string.decode(encoding)
 except UnicodeError:
  return unic(string)

def console_decode ( string , encoding = CONSOLE_ENCODING , force = False ) : if ( is_unicode ( string ) and ( not ( IRONPYTHON and force ) ) ) : return string encoding = { 'CONSOLE' : CONSOLE_ENCODING , 'SYSTEM' : SYSTEM_ENCODING } . get ( encoding . upper ( ) , encoding ) try : return string . decode ( encoding ) except UnicodeError : return unic ( string )
decodes bytes from console encoding to unicode .