diff options
| author | Adam Janovsky | 2021-04-15 14:49:38 +0200 |
|---|---|---|
| committer | Adam Janovsky | 2021-04-15 14:49:38 +0200 |
| commit | 00c0833672a38898580990c8d264762948da280c (patch) | |
| tree | 96c20412aea341c1f695c059fb970542fbbf49cc | |
| parent | 7e5559c3ad5e7599e678b085257652173e251701 (diff) | |
| download | sec-certs-00c0833672a38898580990c8d264762948da280c.tar.gz sec-certs-00c0833672a38898580990c8d264762948da280c.tar.zst sec-certs-00c0833672a38898580990c8d264762948da280c.zip | |
serialize non ascii characters to preserve link functionality
| -rw-r--r-- | sec_certs/certificate.py | 2 | ||||
| -rw-r--r-- | sec_certs/dataset.py | 2 | ||||
| -rw-r--r-- | test/data/test_cc_oop/toy_dataset.json | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sec_certs/certificate.py b/sec_certs/certificate.py index aded72f0..f4f184ef 100644 --- a/sec_certs/certificate.py +++ b/sec_certs/certificate.py @@ -57,7 +57,7 @@ class Certificate(ABC): def to_json(self, output_path: Union[Path, str]): with Path(output_path).open('w') as handle: - json.dump(self, handle, indent=4, cls=CustomJSONEncoder) + json.dump(self, handle, indent=4, cls=CustomJSONEncoder, ensure_ascii=False) @classmethod def from_json(cls, input_path: Union[Path, str]): diff --git a/sec_certs/dataset.py b/sec_certs/dataset.py index eacddddb..858ac891 100644 --- a/sec_certs/dataset.py +++ b/sec_certs/dataset.py @@ -93,7 +93,7 @@ class Dataset(ABC): output_path = self.json_path with Path(output_path).open('w') as handle: - json.dump(self, handle, indent=4, cls=CustomJSONEncoder) + json.dump(self, handle, indent=4, cls=CustomJSONEncoder, ensure_ascii=False) @classmethod def from_json(cls, input_path: Union[str, Path]): diff --git a/test/data/test_cc_oop/toy_dataset.json b/test/data/test_cc_oop/toy_dataset.json index f3ff4d58..98adc9ac 100644 --- a/test/data/test_cc_oop/toy_dataset.json +++ b/test/data/test_cc_oop/toy_dataset.json @@ -28,7 +28,7 @@ ], "not_valid_before": "2020-06-15", "not_valid_after": "2025-06-15", - "report_link": "http://www.commoncriteriaportal.org/files/epfiles/Certification%20Report%20-%20NetIQ\u00ae%20Identity%20Manager%204.7.pdf", + "report_link": "http://www.commoncriteriaportal.org/files/epfiles/Certification%20Report%20-%20NetIQ®%20Identity%20Manager%204.7.pdf", "st_link": "http://www.commoncriteriaportal.org/files/epfiles/ST%20-%20NetIQ%20Identity%20Manager%204.7.pdf", "src": "csv + html", "cert_link": "http://www.commoncriteriaportal.org/files/epfiles/Certifikat%20CCRA%20-%20NetIQ%20Identity%20Manager%204.7_signed.pdf", |
