From 87db158afc2ca2d733eb3a636ed90ae42a7418dc Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 22 May 2026 15:06:37 +0200 Subject: [PATCH] Fix to avoid large diffs when pretty --- web-lib-funcs.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 6beb202e0..768f34f71 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -13315,7 +13315,7 @@ return 0; Converts the given Perl data structure to encoded binary string =item data parameter is a hash/array reference -=item if the output should be prettified +=item if the output should be prettified and hash keys sorted =item raw-utf8 parameter, if set to 1, encodes data using UTF-8 =cut @@ -13334,6 +13334,7 @@ else { error("Neither JSON::XS nor JSON::PP Perl module is available on your system"); } $json->pretty(!!$pretty); +$json->canonical(1) if ($pretty); $data ||= {}; return $raw_utf8 ? $json->utf8->encode($data) : $json->latin1->encode($data); }