Why is this A0 character appearing in my HTML::Element output?

后端 未结 2 1323
予麋鹿
予麋鹿 2021-01-07 17:23

I\'m parsing an HTML document with a couple Perl modules: HTML::TreeBuilder and HTML::Element. For some reason whenever the content of a tag is just  ,

2条回答
  •  忘掉有多难
    2021-01-07 17:53

    The character is "\xa0" (i.e. 160), which is the standard Unicode translation for  . (That is, it's Unicode's non-breaking space.) You should be able to remove them with s/\xa0/ /g if you like.

提交回复
热议问题