xxxxxxxxxx
perl -ne '/^([\x00-\x7f]*)(.*)$/;print "$ARGV:$.:".($-[2]+1).":$_" if length($2)'
xxxxxxxxxx
AddType text/html;charset=UTF-8 html
AddType text/plain;charset=UTF-8 txt
xxxxxxxxxx
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
xxxxxxxxxx
perl -C -e 'print pack("U",0x20ac)."\n"'
perl -C -e 'print "\x{20ac}\n"' # works only from U+0100 upwards
xxxxxxxxxx
perl -ne '/^(([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})*)(.*)$/;print "$ARGV:$.:".($-[3]+1).":$_" if length($3)'
xxxxxxxxxx
perl -C -pe 's/&\#(\d+);/chr($1)/ge;s/&\#x([a-fA-F\d]+);/chr(hex($1))/ge;'