0

I have a client who wanted to restore her old website from 5 years ago with a very small budget. I suggested that she at least uses Wordpress for CMS and now she has a limited editing capability of a portion of the text on each page. We kept all the old php files for the front end and just request the Wordpress content for the left column of the page.

Now, all extra blank spaces that were in the text show up as question marks inside a black diamond. They show as proper blank spaces in Wordpress editor, and in PHPmyAdmin. Our old pages all have UTF-8 encoding.

What I am confused about is that when I enter a double space in Wordpress now, the "new", just made double spaces also come out as question mark on the front end but display as space in MySQL. Shouldn't TinyMCE make " " for this? enter image description here

5
  • Those are control characters that got shoved into the document, possibly from editing the content in Word or some other word processor rather that a proper text editor.
    – s_ha_dum
    Jul 17 '15 at 5:04
  • No, as I mentioned, when I type a double space in TinyMCE it still comes out as a question mark. I am not copying and pasting from Word.
    – Natalia
    Jul 17 '15 at 23:23
  • What is the collation on the database? Or on relevant tables?
    – s_ha_dum
    Jul 18 '15 at 5:39
  • utf8_general_ci
    – Natalia
    Jul 19 '15 at 18:06
  • I am really confused about multiple blank spaces in MySQL text field transferred to HTML. What exactly happens with them? HTML needs ' ' for them to show correctly.
    – Natalia
    Jul 19 '15 at 18:11
1

This has solved my issue

mysqli_query ($connection, "SET NAMES 'utf8'");

https://stackoverflow.com/questions/1707792/issue-with-utf-8-encoding-using-php-mysql

1
  • Interesting. While I don't know the specifics of the problem this does suggest that my encoding suspicion was on the right track.
    – s_ha_dum
    Jul 19 '15 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.