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

Function getlocale

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

Returns the current setting for the given locale category as tuple (language code, encoding). category may be one of the LC_* value except LC_ALL. It defaults to LC_CTYPE. Except for the code 'C', the language code corresponds to RFC 1766. code and

(category=LC_CTYPE)

Source from the content-addressed store, hash-verified

592
593
594def getlocale(category=LC_CTYPE):
595
596 """ Returns the current setting for the given locale category as
597 tuple (language code, encoding).
598
599 category may be one of the LC_* value except LC_ALL. It
600 defaults to LC_CTYPE.
601
602 Except for the code 'C', the language code corresponds to RFC
603 1766. code and encoding can be None in case the values cannot
604 be determined.
605
606 """
607 localename = _setlocale(category)
608 if category == LC_ALL and ';' in localename:
609 raise TypeError('category LC_ALL is not supported')
610 return _parse_localename(localename)
611
612def setlocale(category, locale=None):
613

Callers 1

_print_localeFunction · 0.85

Calls 1

_parse_localenameFunction · 0.85

Tested by

no test coverage detected