I'm moving a site to a new Server, and I'm getting wrong colation in non-english caracters in the new one. In the old server I get "é" in the new one shows " �"
Some tips:
a) Both sites are reading from the same MySQL server, so, the problem isn't any MySQL Server configuration. The static HTML also shows wrong caracters, not only strings coming from the database.
b) Both sites have exactly the same source code. So, there is not anything like just put a <meta charset="UTF-8">
c) Old Server user PHP 5.5.9 the new one PHP 5.6.30, both Ubuntu/Nginx
d) I have checked both php.ini files, I saw no diferences!
e) When a do the shell command curl -I *URL*
I GET:
Old Server:
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 01 Mar 2017 20:00:43 GMT
Content-Type: text/html
Connection: keep-alive
Keep-Alive: timeout=60
X-Powered-By: PHP/5.5.9-1ubuntu4.20
New Server:
HTTP/1.1 200 OK
Server: nginx/1.10.1 (Ubuntu)
Date: Wed, 01 Mar 2017 20:01:21 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
I sow this Content-Type: text/html; charset=UTF-8
in the answer of curl -i
to new server, but I have no idea where it came from.
Any Idea where to find the problem?
Old Server: http://www.pimentaingressos.com/ New One: http://pimenta.curtipiu.net/
For Mysql:
Check you PHP encoding capability: http://php.net/manual/en/function.mb-list-encodings.php
If you use output buffer : http://php.net/manual/en/function.mb-output-handler.php
You can set PHP internal ecnoding http://php.net/manual/en/function.mb-internal-encoding.php
On my live host, i only needed to fix the collation in phphmyadmin to make it work. On my VM for dev, i need to set the internal encoding (point 3 of PHP list) as well. Over the years i've encountered 1 or more of those thing i listed you hope it set you on the right track.