From 61b66813efe84d4d2be5726f736af297b69e468b Mon Sep 17 00:00:00 2001 From: francescoingv <9592487+francescoingv@users.noreply.github.com> Date: Fri, 13 Feb 2026 10:38:05 +0100 Subject: [PATCH] Update base64 encoding to return UTF-8 string Fixed a simple error in json_serial() not returning a string: Decode base64 encoded JSON object to UTF-8 string. --- pygeoapi/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygeoapi/util.py b/pygeoapi/util.py index c91a4c3e0..bf91ae890 100644 --- a/pygeoapi/util.py +++ b/pygeoapi/util.py @@ -378,7 +378,7 @@ def json_serial(obj: Any) -> str: return obj.decode('utf-8') except UnicodeDecodeError: LOGGER.debug('Returning as base64 encoded JSON object') - return base64.b64encode(obj) + return base64.b64encode(obj).decode('utf-8') elif isinstance(obj, Decimal): return float(obj) elif type(obj).__name__ in ['int32', 'int64']: