Skip to content
Snippets Groups Projects
Commit 94dc64de authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Use system default encoding when normalising locale

parent 8ab34d88
No related branches found
No related tags found
No related merge requests found
from locale import locale_alias, locale_encoding_alias
from locale import getpreferredencoding, locale_alias, locale_encoding_alias
from typing import Optional
......@@ -6,5 +6,7 @@ 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)
loc = loc.split(".")[0] + "." + enc
else:
enc = getpreferredencoding()
loc = loc.split(".")[0] + "." + enc
return loc
[tool.poetry]
name = "calendarweek"
version = "0.4.0"
version = "0.4.1"
description = "Utilities for working with calendar weeks in Python and Django"
authors = ["Dominik George <nik@naturalnet.de>", "Jonathan Weth <git@jonathanweth.de>"]
license = "MIT"
......
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