The encoding of the $_FILES['file']
global variable in php is different when a file is uploaded from a Mac than from a Windows computer.
I'm developing a script using PHP7 on a newly updated Debian/Apache2. It worked before the update, but is now failing for file uploads from Mac.
The script is to receive an upload file, and store the file name in a database (MariaDB/mySql)
$filename = "$_FILES['files']";
$sql = "INSERT INTO upload_files (filename) VALUES ('$filename')";
When the filename contains non-ascii characters, such as æøå, this query is executed correctly when the file is uploaded from a Windows computer. But when the file is uploaded from a Mac, the encoding is different, and the query fails:
#1366 - Incorrect string value '\xCC\x8A...' for column filename....