mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix file encoding for some loads.
We've actually been pretty good at getting this right in most of the code base, but we've missed it in a few places. Python defaults to the encoding of the current locale unless otherwise specified, and for a US English Windows install that's cp1252, not UTF-8. I'm not brave enough to change the locale at startup because I don't know how that might affect CJK encoding users (or for that matter, non-Latin derived alphabet UTF-8 variants). Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2786.
This commit is contained in:
@@ -57,7 +57,7 @@ class Campaign:
|
||||
|
||||
@classmethod
|
||||
def from_file(cls, path: Path) -> Campaign:
|
||||
with path.open() as campaign_file:
|
||||
with path.open(encoding="utf-8") as campaign_file:
|
||||
data = yaml.safe_load(campaign_file)
|
||||
|
||||
sanitized_theater = data["theater"].replace(" ", "")
|
||||
|
||||
Reference in New Issue
Block a user