From 7766da0850d76ff2eb1ebc6b83eeb8a4f340df7a Mon Sep 17 00:00:00 2001 From: khashashin Date: Thu, 7 Mar 2024 14:38:25 +0100 Subject: [PATCH] Allow json to store the text in the database without replacing the non-Ascii characters with Unicode alternatives --- ckanext/fluent/validators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ckanext/fluent/validators.py b/ckanext/fluent/validators.py index 50bd73b..d6a26b4 100644 --- a/ckanext/fluent/validators.py +++ b/ckanext/fluent/validators.py @@ -124,7 +124,7 @@ def validator(key, data, errors, context): errors[key].append(_('Required language "%s" missing') % lang) if not errors[key]: - data[key] = json.dumps(value) + data[key] = json.dumps(value, ensure_ascii=False) return # 3. separate fields @@ -157,7 +157,7 @@ def validator(key, data, errors, context): for lang in output: del extras[prefix + lang] - data[key] = json.dumps(output) + data[key] = json.dumps(output, ensure_ascii=False) return validator