Linux UTF-8
Content-Type: text/plain; charset=utf-8
Nice Nightingale
Content-Type: text/plain; charset=utf-8
AddType text/html;charset=UTF-8 html
AddType text/plain;charset=UTF-8 txt
perl -C -e 'print pack("U",0x20ac)."\n"'
perl -C -e 'print "\x{20ac}\n"' # works only from U+0100 upwards
perl -ne '/^([\x00-\x7f]*)(.*)$/;print "$ARGV:$.:".($-[2]+1).":$_" if length($2)'
perl -C -pe 's/([^\x00-\x7f])/sprintf("&#%d;", ord($1))/ge;'
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
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)'
Content-Type: text/html; charset=utf-8
perl -C -pe 's/&\#(\d+);/chr($1)/ge;s/&\#x([a-fA-F\d]+);/chr(hex($1))/ge;'