def _encoding():
 encoding = config['terminal_encoding'].get()
 if encoding:
  return encoding
 try:
  return (locale.getdefaultlocale()[1] or 'utf8')
 except ValueError:
  return 'utf8'

def _encoding ( ) : encoding = config [ 'terminal_encoding' ] . get ( ) if encoding : return encoding try : return ( locale . getdefaultlocale ( ) [ 1 ] or 'utf8' ) except ValueError : return 'utf8'
tries to guess the encoding used by the terminal .