diff --git a/taxdata.py b/taxdata.py index a2ed0b1..0a34466 100644 --- a/taxdata.py +++ b/taxdata.py @@ -12,7 +12,7 @@ def __init__(self, namn, personnummer, postnummer, postort): @staticmethod def read_from(filename): - with open(filename, encoding="utf-8") as f: + with open(filename, encoding="utf-8-sig") as f: d = json.load(f) return PersonalDetails(d["namn"], d["personnummer"], d["postnummer"], d["postort"]) @@ -23,7 +23,7 @@ def __init__(self, fees): @staticmethod def read_from(filename): - with open(filename, encoding="utf-8") as f: + with open(filename, encoding="utf-8-sig") as f: d = json.load(f) return Fees(d["fees"]) @@ -49,7 +49,7 @@ def __init__(self, trades): @staticmethod def read_from(filename): - with open(filename, encoding='utf-8') as f: + with open(filename, encoding='utf-8-sig') as f: lines = [line for line in csv.reader(f, delimiter=',', quotechar='"')] def indices(col_name): @@ -108,7 +108,7 @@ def profit(self): @staticmethod def read_stock_tax_events_from(filename:str): - with open(filename, encoding="utf-8") as f: + with open(filename, encoding="utf-8-sig") as f: d = json.load(f) events = [] for event in d["trades"]: