I maintain a pretty old PHP system, which is interacting with a mysql database table Styles
, which has latin1 encoding. The create syntax (with only the relevant column shown) is below:
CREATE TABLE `StylesTbl` (
`styleName` varchar(40) COLLATE latin1_danish_ci NOT NULL,
) ENGINE=MyISAM AUTO_INCREMENT=21976 DEFAULT CHARSET=latin1 COLLATE=latin1_danish_ci;
As an example, an entry in the database for styleName
is:
"Cityscape 20” black + Cityscape 24” wine".
Which on the production server appears as:
"Cityscape 20� black + Cityscape 24� wine"
The text however appears absolutely fine on my local instance of the server, which is running the same code. So I assume from this that the differences must lie in either the
- PHP version (But both server and my local instance are using 5.6.30)
- Mysql Version (Server uses 5.5, My local is 5.6 -- could this be affecting it??)
Other than the above, the code that is being run is the same, and the database content is the same (I define my local version of the production database using a mysqldump of the production database when I test).
I believe the reaspm issue begins in the first place is that we have a second database which has the names in UTF-8, and when a new style is made in the old database, information is retrieved from the newer database in UTF-8 and saved.