Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    SET NAMES needs to be done when the connection is established. WP does this internally automatically. I’m skeptical that it’s possible to insert additional connection queries. I’d look closer, except using SET NAMES is ill advised because it would cause PHP escaping mechanisms to be ineffective, opening the door for SQL injection attacks.

    In any case, it’s just a cover up of the problem, it doesn’t solve it. Your DumyPage/getcruiseinfo.php is not displaying properly for me, unless you think “Ch?¢teaux” is perfectly acceptable. I believe you are after “Chateau”, yes? In this case and probably your other pages as well, the problem appears to be the original source was UTF-8 encoded, but got corrupted when saved in the DB.

    You say you changed DB_CHARSET, which implies it was something else when the content was saved. Changing the charset here will not change how previous data is encoded. It may be the only solution is to replace the current content with content that is properly encoded.

    Before doing so, you must ensure everything is properly setup to use UTF-8. You’ve corrected the WP end of things, but the database needs to conform too. The charset is individually set in many places in SQL. Each column has its own charset, as does each table, the database, and the server. They all need to be UTF-8.

    Finally, unless you type the content directly into WP after it is properly configured, you need to ensure the source material is also encoded as UTF-8. Depending on the source, this may not be so easy to do. It’s impossible to be sure, but I think the source may have been UTF-8, but it was saved into the DB as something else. Perhaps before you changed DB_CHARSET. Now this converted data is output as UTF-8, so that the corrupted data is now represented in UTF-8, compounding the corruption.

    In summary, ensure everything in the entire data path is all UTF-8, then save the correct content.

    Thread Starter waqasocean

    (@waqasocean)

    Hi,

    I have already set the column “utf8_general_ci” and i have attached the screen which you can see:
    Title
    DB

    You can see in second image, it has saved perfect in my database. But my problem is only that it is not appearing on that page “https://www.riverworldtravel.com/cruise-detail/?cruiseId=MTAxNjU0&genrate_ref=VjE4NDEwOTgxNzExMDU4″ in correct format.

    Please Suggest.

    Thanks.

    • This reply was modified 7 years, 10 months ago by waqasocean.
    Moderator bcworkz

    (@bcworkz)

    According to the title in your image, it is NOT saved perfectly in your database, it is already corrupted. Since it appears your DB is setup properly, then the source material is not UTF-8.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Special Characters Display Incorrect’ is closed to new replies.