Help for this page

Select Code to Download


  1. or download this
     iconv -f utf8 -t utf8 <dodgy_file> || iconv -f iso-8859-1 -t utf8 <dodgy_file> > <utf8_file>
  2. or download this
    perl -MHTML::TreeBuilder::XPath -e'$t= HTML::TreeBuilder::XPath->new;
    $t->parse( "<html><body><p>para &copy;</p></body></html>");
    $p=$t->findvalue( "//p"); 
    print $p, "\n";'
    
  3. or download this
    perl -MHTML::TreeBuilder::XPath -e'$t= HTML::TreeBuilder::XPath->new;
    $t->parse( "<html><body><p>para &copy; &mdash;</p></body></html>");
    @p=$t->findnodes( "//p"); 
    print $p[0]->as_text(), "\n";'
    
  4. or download this
    perl -MHTML::TreeBuilder::XPath -MHTML::Entities -e'
     $t= HTML::TreeBuilder::XPath->new;
     $t->parse( "<html><body><p>para &copy; &mdash;</p></body></html>"); 
    ...
     $out= $p[0]->as_text; 
      encode_entities( $out);
     print $out, "\n";'