0

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)

0

Check the output of locale -a and locale -m to make sure Server B has the correct locales and charsets installed to properly interpret pl_PL.UTF-8

  • Thanks for response.I updated my question to with output of both commands. Do I have to install locale (pl, de, fr ...) for every language that I want to display/use correctly? – marag Oct 16 '15 at 12:54
  • Yes, I would expect at minimum, both servers will need the pl_PL.utf8 locale to properly display the special characters in that set. Based on the server settings you've shown, this seems consistent with the problem you are seeing. – Christopher Hunter Oct 28 '15 at 0:06
  • I've already run dpkg-reconfigure locales then added pl_PL.utf8 and set default locale to pl_PL.utf8. Now polish letters are stiil displayed wrong. When I used mc it was localized to polish, but special letters were displayed incorrectly. – marag Oct 29 '15 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.