0

I have a MySQL database on a shared hosting server and by default it is set to latin1 encoding, but have string values which have foreign characters.

When I query the database in the command line, the values show correctly, ie "Domain Cuvée". However, when I am accessing via php/webpage, the value shows as "Domaine Cuv\u00e9e".

My character set/collation results are below.

SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';


+--------------------------+-------------------+
| Variable_name            | Value             |
+--------------------------+-------------------+
| character_set_client     | latin1            |
| character_set_connection | latin1            |
| character_set_database   | utf8              |
| character_set_filesystem | binary            |
| character_set_results    | latin1            |
| character_set_server     | utf8              |
| character_set_system     | utf8              |
| collation_connection     | latin1_swedish_ci |
| collation_database       | utf8_unicode_ci   |
| collation_server         | utf8_unicode_ci   |

I am unable to access the my.cnf file, so setting the character_set values there is not an option. Is there any way I can show the correct characters via query or changing settings? I've tried changing in phpmyadmin and no avail.

TO clarify, the link below does not answer my question as I am not using php to connect to my database. I am using core data for most of my data connections and I can't modify the charset from the client side.

user2647092
  • 387
  • 2
  • 6
  • 17
  • 1
    you can set the character set for the connection. Also look at the table structure for where that value was stored to see if its `utf8`/ `utf8mb4`. – danblack Dec 05 '18 at 22:42
  • Possible duplicate of [UTF-8 all the way through](https://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – miken32 Dec 05 '18 at 22:49

0 Answers0