1) I migrated WEB page to another server! From Ms Server 2012/Xampp to Cento7/httpd. On Centos7 Web page contains question marks where should be a special characters "āīūņļš". Web page is built on PHP.
Old server is running old XAMP installation:
- PHP Version 5.4.27
- 5.5.36 - MySQL
CentOS running:
- apach/httpd
- PHP 7.0.*
- 5.5.52-MariaDB
2) Both servers contains files with same encoding and DB tables with same charset colletions and both servers have "Server charset is UTF-8 Unicode (utf8)".
Only difference is "Server connection collation". Old server have "Collation" and CentOS have "utf8_general_ci".
3) I tried:
- encode files to utf8
- define utf8 in meta tags
- header('Content-Type: text/html; charset=ISO-8859-1'); and header('Content-Type: text/html; charset=utf8');
- mysqli_set_charset($con,"utf8");
- AddDefaultCharset UTF-8 in httpd.conf
I just don't understand, why on one server everything is OK and on another server text contains "?" when files/php code/db is the same! Is there a chance that the httpd doesn't have some module enabled?
And there is one more problem! Some php files and DB tables have different encoding and char collection. I tried change file encoding to UTF8 and it solved problem for static text in php files. Some text in db contains strange characters and db contains lot of information. In some cases mysqli_set_charset($con,"utf8"); works but there ar times when text randomly disappear when mysqli_set_charset is used!