wp.jochen.hayek.name/blog-en

how do I encode UTF-8 characters into numeric character reference format (in Perl)?

$ echo 'foobar' | perl -pe "s/./ sprintf '&#x%04x;', ord($&) /ge"
Exit mobile version