def get_preferred_output_encoding():
 if hasattr(locale, u'LC_MESSAGES'):
  return (locale.getlocale(locale.LC_MESSAGES)[1] or locale.getdefaultlocale()[1] or u'ascii')
 return (locale.getdefaultlocale()[1] or u'ascii')

def get_preferred_output_encoding ( ) : if hasattr ( locale , u'LC_MESSAGES' ) : return ( locale . getlocale ( locale . LC_MESSAGES ) [ 1 ] or locale . getdefaultlocale ( ) [ 1 ] or u'ascii' ) return ( locale . getdefaultlocale ( ) [ 1 ] or u'ascii' )
get encoding that should be used for printing strings .