in reply to Re^2: Unicode surrogate is illegal in UTF-8
in thread Unicode surrogate is illegal in UTF-8

You can print to a filehandle that doesn't lead anywhere:
open my $VOID, '>', \ my $void; 1 until eval { print {$VOID} $text->{string}; # ...
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ