Per Jessen
2014-10-20 09:11:11 UTC
I've recently had to upgrade PHP on a long-running server (openSUSE
11.0). Yes, there are reasons why this hasn't been upgraded. I
upgraded PHP to 5.3.0 which at first seemed to work just fine.
However, one of the few, rarely used, web-apps left on this box is now
having an encoding issue wrt mysql data and I simply cannot find the
right setting to tweak.
Everything should be in UTF8 - apache outputs utf8 etc., but when the
data comes from mysql - when fetched with e.g. mysqli_fetch_assoc() -
UTF8 characters are interpreted literally instead of as UTF8.
My php.ini has
default_charset = "UTF-8"
mbstring.internal_encoding = "UTF-8"
The database is in utf8:
mysql> show create database db_example;
db_example | CREATE DATABASE `db_example` /*!40100 DEFAULT CHARACTER SET
utf8 COLLATE utf8_unicode_ci */ |
The apache config has:
AddDefaultCharset UTF-8
I've now moved this web-app to a 2nd apache server, also running php
5.3 - the issue remains the same.
I've tried adding mysqli_set_charset() to the code, no effect.
11.0). Yes, there are reasons why this hasn't been upgraded. I
upgraded PHP to 5.3.0 which at first seemed to work just fine.
However, one of the few, rarely used, web-apps left on this box is now
having an encoding issue wrt mysql data and I simply cannot find the
right setting to tweak.
Everything should be in UTF8 - apache outputs utf8 etc., but when the
data comes from mysql - when fetched with e.g. mysqli_fetch_assoc() -
UTF8 characters are interpreted literally instead of as UTF8.
My php.ini has
default_charset = "UTF-8"
mbstring.internal_encoding = "UTF-8"
The database is in utf8:
mysql> show create database db_example;
db_example | CREATE DATABASE `db_example` /*!40100 DEFAULT CHARACTER SET
utf8 COLLATE utf8_unicode_ci */ |
The apache config has:
AddDefaultCharset UTF-8
I've now moved this web-app to a 2nd apache server, also running php
5.3 - the issue remains the same.
I've tried adding mysqli_set_charset() to the code, no effect.
--
Per Jessen, Zürich (15.4°C)
http://www.dns24.ch/ - your free DNS host, made in Switzerland.
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
To contact the owner, e-mail: opensuse+***@opensuse.org
Per Jessen, Zürich (15.4°C)
http://www.dns24.ch/ - your free DNS host, made in Switzerland.
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
To contact the owner, e-mail: opensuse+***@opensuse.org