sub initialize { my $self = shift; my $config = {XMLRPC::Server::initialize(@_)}; my $typelookup = $$config{serializer}->typelookup(); # adjust the definition for base64 data, skip over any scalars with the utf8 property set $typelookup->{base64} = [10, sub {$_[0] =~ /[^\x09\x0a\x0d\x20-\x7f]/ && !utf8::is_utf8($_[0])}, 'as_base64']; return %{$config}; };