Wordpress character encoding issue after upgrade - php

I have a wordpress site hosted on Heroku using nginx, hhvm and mysql.
I was on WP version 4.1 and then upgraded to 4.4.2. Now I see that some of my posts have weird characters (black diamonds with questions marks that you can see below).
Also, when i log in to the wp-admin and try to edit a post, the post editor is completely blank (both visual and text modes), and the wordcount shows 0. However the actual post content is still displayed on the live page and I see in the DB that the posts still exist.
*I've checked the console and this is not because of a javascript error or any sort of jQuery mismatch
I believe this is some sort of character encoding issue, because when I change the encoding settings in chrome to Western ISO-8859-15 the black diamonds go away. The post editor is still broken though.
I've tried changing the character encoding on the database and on the individual tables, but that did not fix the problem. I wonder if this is related to some internal HHVM setting for character encoding. Have not been able to find anything there to change though.

Related

Netbeans - Problem with romanian characters (UTF-8), ț and ș are display as?

This is my netbeans info. I'm writing an website in Romanian and ăîâ work fine, but ț and ș are display as ?.
My encoding is set to UTF-8.
Every things works when I use simple text editor like notepad++, the script runs and characters are displayed correctly in the browser.
This is what I see in netbeans.
I've tried the most popular answer from here and I've also installed
Encoding Support plugin, but the problem still persist. How can I fix this problem?
I've just discovered that this bug was fixed in NetBeans 15.

htaccess php version change & wrong encoding

I'm strugelling with strange problem. My hosting provider do not offer cpanel with PHP config option (i know, disaster). For the purpouses of my website I had to change PHP version from 5.2 to 5.5. So admin told me i can use htaccess and command: AddHandler php5.5-fastcgi php
And ok - it activates proper PHP version, but what is totally strange -> change totally my mysql database encoding. The output is following - all posts, pages etc. which were previously displayed in my native language (polish) right now do not display polish diacritic symbols. I've tried to change the whole database collation to UTF8_general_CI yet it didnt solve the problem. I use wordpress as cms, but the issue appears also in my own cms, as well as plain php with mysql. Any ideas how to change that? thanks!

kannada words are displaying as question marks in firefox browser

I am trying to display kannada words in mozilla browser on Ubuntu 12.04 lts connecting through the MySql.
I have used collation utf-8 general ci and used header('Content-type:text/html; charset=utf-32'); php code in php.
When I tried to retrieve the words from database and display it on the firefox browser it is displaying as question marks...
Please help.
The character encoding that you declare in a header must be the same as the actual encoding. It seems that these differ radically (UTF-32 vs. possibly UTF-8). Find out the actual encoding and declare it.
Don’t use UTF-32 on web pages. Firefox was the last major browser that supported it, and the support was removed in 2011.

Troubles Displaying Arabic Text

I have this website, websiteaddress.com where I'm facing troubles displaying arabic text. Arabic text shows (?????) question marks only.
I had two sessions of chatting with support, but, no result so far.
These options have been tested and didn't solve the issue:
No database connection is actually established for Arabic text. All arabic text is static, no database entries. So, database encoding isn't an issue.
The site is based on wordpress, encoding in settings is set to "UTF-8". Also tried the ISO-8859-1, both gave the same result. (the arabic text doesn't come from the wordpress databse, it's hardcoded within the theme files)
added a default charset to htaccess to UTF-8 as well as ISO-8859-1.
Resent the headers using PHP with UTF-8 encoding and also tried ISO-8859-1.
changed the PHP.INI in my hosting root directory and also under this specific account root directory and changed the encoding from ISO to UTF-8.
So, all the above did not solve the issue.
Also, I have created two testing pages, with exactly the same text inside (in arabic): websiteaddress.com/test.html and websiteaddress.com/test.php .. both were the same pages, I just changed the extensions of the files. The html works fine and displays arabic. The php one doesn't work and displays questions marks.
This is basically the issue.
If anyone has any other option for me to try or know how to go about doing this, please let me know!
I have searched alot on stackoverflow and found alot of solutions, mostly all the above solutions were mentioned in some questions on stackoverflow. But, none of them answered my question, hence the post here..
Thanks and have a great day everyone!
It was solved by my hosting provider, just in case anyone need this. This is their reply:
I checked the php.ini and the changes were not made in there, so I changed them for you. I also edited the following in your php.ini. exif.encode_unicode I set it to UTF-8 and uncommented it. Now the arabic is rendering at: websiteaddress.com/test.php and websiteaddress.com/test.html You can add the following to your .htaccess to get a different php version rendered. The following code is for 5.3. AddType application/x-httpd-php53 .php

Intermittent problem with UTF-8 characters

I am running a fairly standard LAMP stack.
The problem is an intermittent rendering of UTF-8 characters correctly. About 50% of the time the non-ASCII UTF-8 characters render correctly (e.g. with appropriate diacritical marks), but about 50% of the time I get the '?' rendition instead. If I reload the page, sometimes it corrects the problem and sometimes it does not. It happens with all browsers on all platforms, which suggests a MYSQL or Apache problem but I have not been able to figure it out.
The data base itself is in UTF-8 format and I have never seen the problem while browsing the database in phpMyAdmin.
I issue a SET NAMES utf-8 command upon opening the data base (and have tried changing that to a SET CHARSET utf-8 command) with no luck.
What's confusing me is that it is intermittent, happening in streaks, e.g. it will happen on 30 pages in a row (even if they are just reloads), and then clear up for 10 pages, and then happen again for a few pages, etc.
You can try to see the problem by hitting the 'list' button here: http://latin-words.com/list_vocab.php though it may take many reloads to either make it happen or make it go away
Server Configuration:
Ubuntu: 9.10
Mysql: 5.1.37
PHP 5.2.10
Apache 2.2.12
Any hints would be greatly appreciated?
edit:
For searchers sake, from the comments, the problem was actually an issue doing a SET NAMES utf-8; (incorrect) instead of an SET NAMES utf8; (correct) That doesn't mean my much more obscure reason posted below cannot also be the reason ;)
Sounds like a problem with locales & iconv, try to determine what locale is used in the webserver process the moment all is well, and the moment it doesn't work anymore (try $currentlocale = setlocale(LC_ALL,NULL); or $currentlocale = setlocale(LC_CTYPE ,NULL); to get the used locale).

Categories