- or download this
$_ = "This line contains 0xC30x86n exotic character.";
s/0x([0-9a-fA-F]{2})/chr(hex($1))/eg;
utf8::decode($_);
- or download this
use HTML::Entities qw( encode_entities );
open(my $fh, '>:encoding(UTF-8)', 'file.html') or die;
print $fh qq{<meta http-equiv="Content-Type" content="text/html; chars
+et=UTF-8">\n};
print $fh qq{<title>Test</title>\n};
print $fh encode_entities($_); # Escapes &<>'"
- or download this
3C 6D 65 74 61 20 68 74-74 70 2D 65 71 75 69 76 <meta http-equiv
3D 22 43 6F 6E 74 65 6E-74 2D 54 79 70 65 22 20 ="Content-Type"
...
69 6E 65 20 63 6F 6E 74-61 69 6E 73 20 26 41 45 ine contains &AE
6C 69 67 3B 6E 20 65 78-6F 74 69 63 20 63 68 61 lig;n exotic cha
72 61 63 74 65 72 2E racter.