use utf8; use File::Slurp; use Encode; my $ustr = "simple unicode string \x{0434} indeed"; #Encode::_utf8_off($ustr); # ???? why do I need this? File::Slurp::write_file("a.txt", {binmode=>':utf8'}, $ustr);