I 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 string.

It’s pretty simple to do so in PHP, I learned from here:

the following iconv line gets rid of all invalid UTF-8 characters.

 $t = iconv("UTF-8","UTF-8//IGNORE",$t);

Problem solved ;)

Popularity: 7% [?]



One Comment to “PHP code to fix invalid UTF-8 data inside a string”

  1. Visitor903 | August 15th, 2007 at 6:06 am

    I have visited your site 119-times

Leave a Comment

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