My database area is placed to utf8_general_ci and my websites encoding is utf8.

The £ symbol is approaching like a black gemstone having a question mark with the center.

I attempted altering it to £ within the database also it just outputted £

I attempted a string replace:

  $row['Information'] = str_replace("£", "£", $row['Information']);

Nothing appears to operate, any ideas?

I attempted altering it to £ within the database

Don't. The database should contain raw text, never HTML-encoded content. Time to HTML-scribe (using htmlspecialchars()) happens when you place some raw text into HTML in the output templating stage, and never before. Even when you have this to operate, you'd have only fixed one character another 107025 non-ASCII figures would still break.

Clearly there's a mismatch of encodings here you have to ensure you apply the same encoding (ideally UTF-8) everywhere, particularly:

  • the encoding you've saved the PHP file in, whether it consists of any non-ASCII figures
  • the charset declared around the output page (by Content-Type <meta> or header(), ideally both should you just use a <meta> to create it and also the server is improperly set up it might set its very own charset overriding yours)
  • the encoding from the column within the database (each column features its own collation, so just setting it up for grabs is ineffective)
  • the encoding utilized by PHP to speak to MySQL. This ought to be set using mysql_set_charset.

Regrettably, none of those configurations default to UTF-8.

Before interacting together with your database, you have to send the query :


It informs the database to make use of utf8 encoding for those queries about this connection.