problem encoding mysql 5.6
Hello,
I can't insert into my data base a special characters, for exemple when I insert the word "h"tel" I have in my base "h?tel". Only latin1 is supported but impossible with UTF8.
This is my configuration:
[LIST]
Version du serveur : 5.6.21 - MySQL Community Server (GPL)
Jeu de caract"res du serveur : UTF-8 Unicode (utf8)
cpsrvd 11.44.3.1
Version du client de base de donn"es : libmysql - 5.1.73
Extension PHP : mysqli
PhpMyadmin: 4.1.8
I have insert in my code, after INSERT INTO:
[LIST]
mysql_set_charset('utf8mb4');
In my MySQL configuration file (/etc/my.cnf):
[LIST]
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
My data base is in utf8mb4_unicode_ci
-
Hello, I have found the probleme, it's in my php, not with my data base: when I try: $sql = 'INSERT INTO table VALUES ("accentu"")'; => it's ok but when I try: mysql_set_charset('utf8'); $test=utf8_decode( 'Texte accentu"' ); echo $test; $sql = 'INSERT INTO firas VALUES ("'.$test.'")'; => I have in my echo: accentu? and in my data base: accentu? How Can I force php to work with UTF8? I have add this in httpd.conf: AddDefaultCharset utf-8 0 -
Hello, You can change the "default_charset" value in /usr/local/lib/php.ini via: "WHM Home " Service Configuration " PHP Configuration Editor " Advanced Mode" Thank you. 0
Please sign in to leave a comment.
Comments
2 comments