mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-18378: Recognize "UTF-8" as a valid name in locale._parse_localename (GH-14736)
This commit is contained in:
parent
fa220ec763
commit
b0caf32981
3 changed files with 41 additions and 0 deletions
|
@ -492,6 +492,10 @@ def _parse_localename(localename):
|
|||
return tuple(code.split('.')[:2])
|
||||
elif code == 'C':
|
||||
return None, None
|
||||
elif code == 'UTF-8':
|
||||
# On macOS "LC_CTYPE=UTF-8" is a valid locale setting
|
||||
# for getting UTF-8 handling for text.
|
||||
return None, 'UTF-8'
|
||||
raise ValueError('unknown locale: %s' % localename)
|
||||
|
||||
def _build_localename(localetuple):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue