Yesterday, I decided to host my feeds with FeedBurner like many bloggers do. There is no problem to create a feed of this blog, however when i tried to create a feed for my Chinese blog, FeedBurner refuse to continue because it said that my feed can’t be validated:

http://feedvalidator.org/check.cgi?url=http%3a%2f%2frobertmao.com%2ffeed

Sorry

This feed does not validate.

line 167, column 77: ‘utf8′ codec can’t decode bytes in position 10676-10678: invalid data (maybe a high-bit character?) [help]

In addition, this feed has issues that may cause problems for some users.
We recommend fixing these issues.

line 115, column 21: description contains bad characters [help]


After I check the error message, it seemed that the problem is from my blog post content, I did copy/paste some text from some other website in some of my posts, but how could I know those text may contain invalid UTF-8 char? It seemed to be a serious problem. :(

I can’t believe that why FeedBurner can’t handle this, since my feed can be read correctly in Firefox, Google Reader, Bloglines, and a bunch of other RSS readers, aggregators. But since it can’t handle, and my feed did have problem to pass validation, it’s my job to fix it.

I wrote a very simple wordpress plugin to fix this problem, it will correct all possible invalid UTF-8 data inside the feed content. After I activate my plugin, my feed can pass the validation correctly, so I have no problem to use FeedBurner any more.

I release this simple wordpress plugin here, just in case someone else have similar problem as I had.

Download: wordpress plugin to fix the invalid UTF-8 data inside the feed

Version: 1.0

Install: Download and unzip the file in your wp-content/plugins directory, and then “activate” the plugin in your admin panel’s “plugins” menu.

Popularity: 16% [?]



6 Comments to “A wordpress plugin to fix the invalid UTF-8 data inside the feed”

  1. Inmates Are Running Asylum » Blog Archive » PHP code to fix invalid UTF-8 data inside a string | July 16th, 2007 at 8:06 pm

    […] wrote A wordpress plugin to fix the invalid UTF-8 data inside the feed, in that plugin the core purpose is to  fix invalid UTF-8 data inside a […]

  2. 我blog故我在 » Blog Archive » 写了个wordpress plugin 修复了feed中非法UTF-8字符的问题 | July 16th, 2007 at 10:29 pm

    […] 发布在我的英文blog中了:A wordpress plugin to fix the invalid UTF-8 data inside the feed […]

  3. indittido | November 27th, 2007 at 5:46 pm

    Hi, hello, privet
    newsvendor

  4. James Farmer | November 28th, 2007 at 9:57 pm

    Just gotta say a great big thanks for this! Works like a dream and solved a big headache!

    Cheers, James

  5. Richard | March 23rd, 2008 at 1:07 pm

    This doesn’t work for me. Now, my feedburner points to the rss-utf-i-fix.php as the problem.

    Here is the error from the validator:

    Fatal error: Call to undefined function: iconv() in …wp-content\plugins\rss-utf-8-fix.php on line 14

    Any thoughts?

    I woudl love this tool if I am able to get it to work.

    Thanks,
    Richard

  6. RaveN | May 2nd, 2008 at 12:58 am

    THANKS a lot :)

Leave a Comment

Close
E-mail It
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.