The UTF-8 encoding will (by default) encode replacement characters for noncharacters, surrogates, and codepoints outside the Unicode range, whereas the 'utf8' encoding will blindly encode to Perl's internal approximation of UTF-8 that has no such restrictions.
Also, remove the explicit specification of FB_DEFAULT, since specifying it will remove the implicit LEAVE_SRC option causing $self->{context} to get modified in place.
The UTF-8 encoding will (by default) encode replacement characters for noncharacters, surrogates, and codepoints outside the Unicode range, whereas the 'utf8' encoding will blindly encode to Perl's internal approximation of UTF-8 that has no such restrictions.
Also, remove the explicit specification of FB_DEFAULT, since specifying it will remove the implicit LEAVE_SRC option causing
$self->{context}
to get modified in place.