Help for this page

Select Code to Download


  1. or download this
    $toencode=~s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg;
    
  2. or download this
    # Build a char->hex map
    for (0..255) {
        $escapes{chr($_)} = sprintf("%%%02X", $_);
    }
    $text =~ s/([^;\/?:@&=+\$,A-Za-z0-9\-_.!~*'()])/$escapes{$1}/g;