How to work around the Warning: cannot yet handle MBCS in html_entity_decode()! error with WP-Postviews
- 5 Comment
If you're new here, you may want to start with my most popular posts. Then, subscribe to my RSS feed to stay updated. Thanks for visiting!
Searchmarked.com Tip
I don’t remember exactly where I found this little hack or I would have put the usual google query with a link to the source in this post. So whoever you are out there, thank you. I love the WP-Postviews plugin, but I found out after some Googling that it does not work with PHP 4 (only PHP 5). You will get the following error:
MBCS in html_entity_decode()!
Fortunately, if your site uses utf-8 encoding you can use the following one line hack to work around the PHP 4 incompatibility.
Make sure you make a backup of your wp-postviews.php file before you edit it.
-Open up wp-postviews.php in your favorite text editor.
-Look for the following line:
$text = html_entity_decode($text, ENT_QUOTES, get_option('blog_charset'));
-Replace the line with the following:
$text = utf8_decode($text);
That’s it! WP-Postviews should work perfectly now. It did for me at least
. Thanks for the awesome plugin Lester!
Technorati Tags: Wordpress, Plugins, Programming, PHP
Related posts:
5 Comments on this post
Trackbacks
-
GaMerZ said:
Thanks for the compliments =D
July 2nd, 2008 at 2:18 am -
hstagner said:
You are welcome! Thanks for stopping by and thanks for creating the awesome plugin.
Regards,
Harley Stagner
July 2nd, 2008 at 2:53 am -
V said:
This post was extremely helpful.
Congratulations for your great blog!
.-
September 7th, 2008 at 3:51 pm -
Tacky News said:
Thanks for this it fixed my problem! Host must still be using PHP4.
September 19th, 2008 at 4:19 pm -
Metin said:
I cant find solution anywhere but this is perfect
thanks thanks thanks…September 24th, 2008 at 6:11 pm


