package FU::Util 0.1; use v5.36; use FU::XS; use Exporter 'import'; our @EXPORT_OK = qw/json_format/; sub json_format($val, %opt) { my $r = FU::XS::json_format($val); # XXX: Does this go over the bytes? If so, not setting SvUTF8_on() in the first place would be much faster. utf8::encode($r) if $opt{utf8}; $r } 1;