How to work around the Warning: cannot yet handle MBCS in html_entity_decode()! error with WP-Postviews
- 15 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
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.
15 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 -
Abhilash said:
Thans a lot hstagner. This worked perfectly.
Very gratefulOctober 25th, 2008 at 11:30 pm -
dlv said:
wow, some second googling and i get your answer
thanks so much, it’s work perfectly in my site
thanks !October 26th, 2008 at 12:55 pm -
Dionisio Rearte said:
Cool. It worked fine. Only one trouble: special characters (my blog is sp: á é í ó ú and ñ) do not print correctly, I’m working on it.
Thanks for your hacker attitude.November 1st, 2008 at 12:37 pm -
Patrick said:
Thanks for the resolution. It worked without upgrading to PHP5.
November 1st, 2008 at 10:36 pm -
Tooksara said:
Thank you so much. Hope I will don’t need to hack more
June 11th, 2009 at 11:04 am -
Mozer said:
THANK YOU SO MUCH! I used this on a Joomla site and it saved me tons of trouble.
January 3rd, 2010 at 1:38 am -
Muhammad Fahd said:
Thank you so much for this contribution
February 4th, 2010 at 4:15 pm -
Arun said:
Wow thanks u so much it work perfectly…
February 23rd, 2010 at 10:09 am -
geoge said:
July 28th, 2011 at 10:27 am


[...] To work around this problem, I found some great notes on SearchMarked.com. [...]