Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7087303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:39:28+00:00 2026-05-28T07:39:28+00:00

I have a PHP website with the CLEditor richtext control on it. When I

  • 0

I have a PHP website with the CLEditor richtext control on it. When I try to write Euros and British Pounds to the database, the character goes through just fine because I have the charset set to UTF-8 in the containing page HTML, in the richtext control IFRAME HTML, and in the MySQL table collation. All is well on that front. However, when I try to write smart quotes, I end up seeing this output in the database:

This is a “testâ€.

(If that doesn’t show up properly above in you browser, the test word has something like a Latin a, a Euro symbol, and the small AE symbol in front of the word, and a Latin a and a Euro symbol after it.)

When I use PHP to read that value back out of the database to display it on the page, it ends up as black diamonds with question marks on them as well as some other Latin characters.

What should I be doing to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:39:28+00:00Added an answer on May 28, 2026 at 7:39 am

    First, make sure your MySQL table is using UTF-8 as its encoding. If it is, it will look like this:

    mysql> SHOW CREATE TABLE Users (
    ...
    ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 |
    

    Next, make sure your HTML page is set to display UTF-8:

    <html>
        <head>
            <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
        </head>
        ....
    </html>
    

    Then it should work.


    EDIT: I purposefully did not talk about collation, because I thought it was already considered, but for the benefit of everyone, let me add some more to this answer.

    You state,

    I have the charset set to UTF-8 … in the MySQL table collation.

    Table collation is not the same thing as charset.

    Collation is the act of automagically trying to convert one charset to another FOR THE PURPOSES OF QUERYING. E.g., if you have a charset of latin1 and a collation of UTF-8, and you do something like SELECT * FROM foo WHERE bar LIKE ‘%—%’; (UTF-8 U+2014) on a table with a charset of latin1 that match either L+0151 or U+2014.

    Not so coincidentally… if you were output this latin1 encoded character onto a UTF-8 encoded web page, you will get the following:

    This is a “testâ€.

    That seems to be the output of your problem, exactly. Here’s the HTML to duplicate it:

    <?php
    $string = "This is a “test”.";
    ?>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html;charset=utf8"/>
        </head>
        <body>
            <p><?php echo $string; ?></p>
        </body>
    </html>
    

    Make sure you save this file in latin1…

    To see what charset your table is set to, run this query:

    SELECT CCSA.character_set_name, TABLE_COLLATION FROM information_schema.`TABLES` T,
           information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA
    WHERE CCSA.collation_name = T.table_collation
      AND T.table_schema = "database"
      AND T.table_name = "table";
    

    The only proper results for your uses (unless you’re using multiple non-English languages) is:

    +--------------------+-----------------+
    | character_set_name | TABLE_COLLATION |
    +--------------------+-----------------+
    | utf8               | utf8_general_ci |
    +--------------------+-----------------+
    

    Thanks for the upvotes 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP website backed by a MySQL database and a small team
I want to control the access in php website. I have a solution right
I have a php built website with a mysql database. I need an sql
I have a problem with maintenance of my php based website. My website is
I have been using PHP and JavaScript for building my dad's website. He wants
I'm developing a website in PHP and I have large JS files that I
I'm fairly new to PHP and have built a medium sized website using standard
Is it possible to check who is entering your website in PHP. I have
I have a website built in PHP 4 with a framework made by hand
I have a website which uses PHP and HTML pages, I want to create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.