Title: Error since i upgraded
Last modified: August 22, 2016

---

# Error since i upgraded

 *  Resolved [Daniel](https://wordpress.org/support/users/gabu69/)
 * (@gabu69)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/error-since-i-upgraded/)
 * Since i upgraded to the latest version I get this error:
 * Warning: htmlspecialchars(): charset `ANSI_X3.4-1968′ not supported, assuming
   utf-8 in /home/okchicas/public_html/wp-content/plugins/wordpress-popular-posts/
   wordpress-popular-posts.php on line 3048
 * When showing the posts via the php function :S
    site: [http://bit.ly/1sv3B75](http://bit.ly/1sv3B75)
 * how can I fix this?
 * [https://wordpress.org/plugins/wordpress-popular-posts/](https://wordpress.org/plugins/wordpress-popular-posts/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/error-since-i-upgraded/#post-5396653)
 * Hi there!
 * The plugin is attempting to use the character set configured by your WordPress
   blog (that’d be _ANSI\_X3.4-1968_), but apparently your current PHP version doesn’t
   like it that much.
 * Workaround:
    1. Go to _Plugins > Editor_, and use dropdown at the right to select _WordPress
       Popular Posts_.
    2. Find:
    3.     ```
           // Get blog charset
           $this->charset = get_bloginfo('charset');
           ```
       
    4. … and change it to:
    5.     ```
           // Get blog charset
           //$this->charset = get_bloginfo('charset');
           ```
       
    6. Hit the _Update file_ button to save changes.
 * This will make WPP use UTF 8 as the character set and the PHP warning will go
   away.
 * Keep in mind that this modification will be lost next time the plugin is updated
   so you might want to bookmark this topic for future reference. The alternative
   would be to ask your host to set PHP’s default character set to UTF 8 (and you
   may need to [change your database’s character set too](http://codex.wordpress.org/Converting_Database_Character_Sets)
   after that too).
 *  Thread Starter [Daniel](https://wordpress.org/support/users/gabu69/)
 * (@gabu69)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/error-since-i-upgraded/#post-5396666)
 * thanks for the fix
 * Why was this not happening before and until this last upgrade?
 *  Thread Starter [Daniel](https://wordpress.org/support/users/gabu69/)
 * (@gabu69)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/error-since-i-upgraded/#post-5396672)
 * Good day hector
 * I tried changing my dabatabse to UTF-8 (my php characters default was already
   UTF8) since some tables were not UTF-8 and the error is still there
 * [http://bit.ly/1sv3B75](http://bit.ly/1sv3B75)
 * You can notice, 3 out of 6 boxes are displayed, but the other 3 don’t show up
   and shows that error
 * so it might be another thing?
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/error-since-i-upgraded/#post-5396678)
 * > Why was this not happening before and until this last upgrade?
 * That’s because it was not until recently (version 3.1.0, if I remember correctly)
   that WPP started passing the character set to string manipulation functions (
   such as the ones needed to shorten the post title, or the one for the post excerpt,
   etc) so that accented characters would display correctly on the page.
 * > I tried changing my dabatabse to UTF-8 (my php characters default was already
   > UTF8) since some tables were not UTF-8 and the error is still there
 * You probably also need to change a value on your _wp\_options_ table as well.
   There’s an _option\_name_ called _blog\_charset_, set its value to _UTF-8_. I
   believe that should fix it.
 *  Thread Starter [Daniel](https://wordpress.org/support/users/gabu69/)
 * (@gabu69)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/error-since-i-upgraded/#post-5396683)
 * > You probably also need to change a value on your wp_options table as well. 
   > There’s an option_name called blog_charset, set its value to UTF-8. I believe
   > that should fix it.
 * It’s set as UTF-8, idk what is wrong then :S
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/error-since-i-upgraded/#post-5396684)
 * That’s odd. Something else is reporting PHP that your charset is ANSI_X3.4-1968.
   It might be a theme related thing, but you should probably ask your hosting about
   it to be sure.
 * Anyways, an additional temporary fix, same as before:
    1. Go to _Plugins > Editor_, and use dropdown at the right to select _WordPress
       Popular Posts_.
    2. Find:
        `$atts .= ' ' . $key . '="' . htmlspecialchars($arg, ENT_QUOTES, false).'"';`…
       and change it to: `$atts .= ' ' . $key . '="' . htmlspecialchars($arg, ENT_QUOTES,"
       UTF-8", false) . '"';`
    3. Hit the _Update file_ button to save changes.
 *  Thread Starter [Daniel](https://wordpress.org/support/users/gabu69/)
 * (@gabu69)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/error-since-i-upgraded/#post-5396702)
 * Works
 * tyty

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Error since i upgraded’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

## Tags

 * [charset](https://wordpress.org/support/topic-tag/charset/)
 * [encoding](https://wordpress.org/support/topic-tag/encoding/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 7 replies
 * 2 participants
 * Last reply from: [Daniel](https://wordpress.org/support/users/gabu69/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/error-since-i-upgraded/#post-5396702)
 * Status: resolved