I have problem when I copy file from Server A (Debian 7.4) to Server B (Debian 7.4). Polish special characters in files are not displayed correctly on Server B (in mcedit).
I created file with polish special character on server A. It is displayed correctly on Server A. When I run locale
on Server A i got LANG=pl_PL.UTF-8
Other variables except LANGUAGE
and LC=ALL
also are set to pl_PL.UTF-8
. Then I tar file, and on Server B I download the tarred file with wget command. On Server B I untar file and when I look at the file content (mcedit) then polish letters are displayed incorrect. There are "diamonds" instead of special chars. When I run locale
on server B then LANG=en_US.UTF-8
. Other variables except LANGUAGE
and LC=ALL
also are set to en_US.UTF-8
.
Then I run database migrations (php script) and corrupted data is inserted into database. When I add rows in migration then polish special chars are replaced by strings like Å›
(polish letter ś
is replaced by Å›
).
I checked in mcedit that file on server A and on server B has the same value on both servers. Polsih letter 'ś' is C5 9B (hex) on both machines.
The worst thing is that every time there are special chars I have to manually check and correct errors in database.
Probably when I edit column values in database by php migration script it also corrupts my data in database. Once I read data from table, then manipulated and then saved and my data was also corrupted.
If I change locales on Server B to pl_PL.UTF-8
then special chars in other languages (like german, czech etc.) will be working OK? If it it is problem with fonts then why also database migrations are corrupted? I am using UTF-8 then every special char from every language should be displayed correctly? How to properly display special chars from every language and what to do to php migrations were performed correctly?
UPDATE 1:
Server A locale -a
outputs:
C
C.UTF-8
pl_PL.utf8
POSIX
Server B locale -a
outputs:
C
C.UTF-8
en_US.utf8
POSIX
On both servers locale -m outputs a lot of charmaps (seems the same on both machines)