Skip to content
Snippets Groups Projects
Verified Commit 67fe9193 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Leave empty locale unchanged when normalising

parent 83378b2e
No related branches found
No related tags found
No related merge requests found
......@@ -4,9 +4,10 @@ from typing import Optional
def normalise_locale(loc: str, enc: Optional[str] = None) -> str:
loc = locale_alias.get(loc, loc)
if enc:
enc = locale_encoding_alias.get(enc.replace("-", ""), enc)
else:
enc = getpreferredencoding()
loc = loc.split(".")[0] + "." + enc
if loc:
if enc:
enc = locale_encoding_alias.get(enc.replace("-", ""), enc)
else:
enc = getpreferredencoding()
loc = loc.split(".")[0] + "." + enc
return loc
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment