Lines Matching refs:encoding

358         If the given encoding is not known, the function defaults to
359 the default encoding for the locale code just like setlocale()
363 # Normalize the locale name and extract the encoding
368 # ':' is sometimes used as encoding delimiter.
371 langname, encoding = fullname.split('.')[:2]
372 fullname = langname + '.' + encoding
375 encoding = ''
377 # First lookup: fullname (possibly with encoding)
378 norm_encoding = encoding.replace('-', '')
380 lookup_name = langname + '.' + encoding
386 # Second try: langname (without encoding)
395 if encoding:
396 # Convert the encoding to a C lib compatible encoding string
397 norm_encoding = encodings.normalize_encoding(encoding)
398 #print 'norm encoding: %r' % norm_encoding
401 #print 'aliased encoding: %r' % norm_encoding
402 encoding = locale_encoding_alias.get(norm_encoding,
405 encoding = defenc
406 #print 'found encoding %r' % encoding
407 if encoding:
408 return langname + '.' + encoding
418 result as tuple (language code, encoding).
424 The language code corresponds to RFC 1766. code and encoding
448 encoding).
453 language, encoding = localetuple
456 if encoding is None:
459 return language + '.' + encoding
464 them as tuple (language code, encoding).
480 1766. code and encoding can be None in case the values cannot
488 code, encoding = _locale._getdefaultlocale()
492 # make sure the code/encoding values are valid
498 return code, encoding
517 tuple (language code, encoding).
523 1766. code and encoding can be None in case the values cannot
535 a string, an iterable of two strings (language code and encoding),
595 # comes with X11 and then hand edited removing the explicit encoding
601 # The local_encoding_alias table maps lowercase encoding alias names
602 # to C locale encoding names (case-sensitive). Note that normalize()
603 # first looks up the encoding in the encodings.aliases dictionary and
605 # encoding.
609 # Mappings for non-standard encoding names used in locale names
617 # Mappings from Python codec names to C lib encoding names
651 # language name is needed to interpret the given encoding alias
655 # removes '_' and '-' characters from the encoding part of the