【Error】RSS atom.xml 解析錯誤:Input is not proper UTF-8, indicate encoding !

打開RSS的鏈接:atom.xml,報錯如下:

This page contains the following errors:
error on line 20 at column 16: Input is not proper UTF-8, indicate encoding !
Bytes: 0x15 0x3C 0x2F 0x70
Below is a rendering of the page up to the first error.

搜索之後發現是由於XML的規定中不允許出現一些特殊字符:
 

The following are the character ranges for low-order non-printable ASCII characters that are rejected by MSXML versions 3.0 and later:
#x0 - #x8 (ASCII 0 - 8)
#xB - #xC (ASCII 11 - 12)
#xE - #x1F (ASCII 14 - 31)

 

解決辦法,搜索文檔中不合法的特殊字符,用vim打開刪掉即可。

grep -n "\x15"

參考:

1. https://blog.csdn.net/ISaiSai/article/details/53899089

2. https://support.microsoft.com/en-us/help/315580/prb-error-message-when-an-xml-document-contains-low-order-ascii-charac

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章