MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _build_localename

Function _build_localename

tools/python-3.11.9-amd64/Lib/locale.py:513–532  ·  view source on GitHub ↗

Builds a locale code from the given tuple (language code, encoding). No aliasing or normalizing takes place.

(localetuple)

Source from the content-addressed store, hash-verified

511 raise ValueError('unknown locale: %s' % localename)
512
513def _build_localename(localetuple):
514
515 """ Builds a locale code from the given tuple (language code,
516 encoding).
517
518 No aliasing or normalizing takes place.
519
520 """
521 try:
522 language, encoding = localetuple
523
524 if language is None:
525 language = 'C'
526 if encoding is None:
527 return language
528 else:
529 return language + '.' + encoding
530 except (TypeError, ValueError):
531 raise TypeError('Locale must be None, a string, or an iterable of '
532 'two strings -- language code, encoding.') from None
533
534def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
535

Callers 2

setlocaleFunction · 0.85
resetlocaleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected