“Linux UTF-8” Réponses codées

Linux UTF-8

Content-Type: text/plain; charset=utf-8
Nice Nightingale

Linux UTF-8

AddType text/html;charset=UTF-8 html
  AddType text/plain;charset=UTF-8 txt
Nice Nightingale

Linux UTF-8

perl -C -e 'print pack("U",0x20ac)."\n"'
  perl -C -e 'print "\x{20ac}\n"'           # works only from U+0100 upwards
Nice Nightingale

Linux UTF-8

perl -ne '/^([\x00-\x7f]*)(.*)$/;print "$ARGV:$.:".($-[2]+1).":$_" if length($2)'
Nice Nightingale

Linux UTF-8

perl -C -pe 's/([^\x00-\x7f])/sprintf("&#%d;", ord($1))/ge;'
Nice Nightingale

Linux UTF-8

<META http-equiv=Content-Type content="text/html; charset=UTF-8">
Nice Nightingale

Linux 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)'
Nice Nightingale

Linux UTF-8

Content-Type: text/html; charset=utf-8
Nice Nightingale

Linux UTF-8

perl -C -pe 's/&\#(\d+);/chr($1)/ge;s/&\#x([a-fA-F\d]+);/chr(hex($1))/ge;'
Nice Nightingale

Réponses similaires à “Linux UTF-8”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code