I'm finding some older answers to this questions, but as I got this problem just now, I'm reposting as I assume there are different answers now.
I have a Mysql database (MariaDB) coded in latin1. After a server upgrade, som of my php scripts stopped working. I think at least php was updated in the process.
It appears that I'm having problems with character encoding.
1) I'm unable to insert string values in the database containing non-ascii characters such as æ, ø and å. The string values comes from the file_name of an upload file $_FILES('file')
.
2) Using phpMyAdmin (version 4.6.4 - latest Debian release) trying the query SELECT * FROM files WHERE filename = '%å%'
returns no results, allthough there are several records having "å" in the filename. (Trying a similar query on an UTF8-encoded database uing phpMyAdmin, returns all rows!).
There are som older claims that PEAR DB does not support UTF8, only latin1. But this may not be true anymore. I've found there is a mysql_set_charset( 'UTF8') that should do the trick, but I want to stick to PEAR DB.
Any ideas?