Help for this page

Select Code to Download


  1. or download this
    sub convert_to_html_entities {
       my $str= shift;
       utf8::decode($str);
       $str =~ s/[\x{201A}-\x{2122}]/ '&#'.ord($&).';' /ger;
    }
    
  2. or download this
    sub convert_nonascii_to_html_entities {
       my $str= shift;
       utf8::decode($str);
       $str =~ s/[^\x20-\x7E]/ '&#'.ord($&).';' /ger;
    }