How can I decode HTML entities?

前端 未结 5 1432
自闭症患者
自闭症患者 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:39

    There are a handful of predefined HTML entities - & " > and so on - that you could hard code.

    However, the larger case of numberic entities - { - is going to be much harder, as those values are Unicode, and conversion to ASCII is going to range from difficult to impossible.

提交回复
热议问题