How can I decode HTML entities?

前端 未结 5 1425
自闭症患者
自闭症患者 2021-02-01 04:43

Here\'s a quick Perl question:

How can I convert HTML special characters like ü or ' to normal ASCII text?

I started

5条回答
  •  你的背包
    2021-02-01 05:22

    Take a look at HTML::Entities:

    use HTML::Entities;
    
    my $html = "Snoopy & Charlie Brown";
    
    print decode_entities($html), "\n";
    

    You can guess the output.

提交回复
热议问题