word/edit: ignore unicode in json metadata
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 15 Oct 2021 11:42:20 +0000 (13:42 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 25 Oct 2021 14:33:21 +0000 (16:33 +0200)
The shorthand function enables utf8 for binary safety, but breaks on
"wide characters" in our encoded values (such as in label convert options).

word/edit.plp

index d7f093a9e3c59581570fdcf6bb4b7dd0088320cf..1aade3e4d2d64d83f283997f269765bb122eb0a9 100644 (file)
@@ -228,7 +228,7 @@ else {
 }
 
 eval {
-       my $imagerow = $row->{image} && decode_json(delete $row->{image}) || {};
+       my $imagerow = $row->{image} && JSON->new->decode(delete $row->{image}) || {};
        while (my ($col, $val) = each %{$imagerow}) {
                $row->{$col} = $val;
        }