From 2785c7d275be05280ec181d7d68679bca7140691 Mon Sep 17 00:00:00 2001 From: David Andreoletti Date: Tue, 23 Jan 2024 17:19:15 +0800 Subject: [PATCH] fix: encoded special characters properly when reading JSON strings --- pass_import/managers/onepassword.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pass_import/managers/onepassword.py b/pass_import/managers/onepassword.py index 198abe2..fb38e44 100644 --- a/pass_import/managers/onepassword.py +++ b/pass_import/managers/onepassword.py @@ -103,6 +103,9 @@ def pif2json(file): cleaned = [v for v in cleaned if len(v) > 0] cleaned = ','.join(cleaned).rstrip(',') cleaned = f'[{cleaned}]' + # JSON string with eventual special characters are encoded properly + # eg: NUL, TAB + cleaned = json.dumps(json.loads(cleaned, strict=False)) return json.loads(cleaned) def parse(self):