November 11, 201213 yr Hi, I've just setup a LAMP server on a Centos 6.3 x64 VPS. php files on the VPS when viewed with winscp etc display the Thai Language as either ¸ªà¸¹à¸•รส or ??????? though. On the old host It displays the Thai script fine through winscp. When the php webpage renders through apache on the VPS the Thai script displays fine with no config changes so I guess the httpd knows how to handle it. I changed the php.ini to a UTF8 charset but that doesn't seem to have fixed it. I thought this would be a good place to ask. Any ideas? thanks
November 14, 201213 yr That is because your new host is not set to UTF-8. Changing "php.ini" is irrelevant as it only effects PHP, not your login environment. Login to your old host and check out what the locale is set to, and add that to the new host.
November 14, 201213 yr Author The host is already set to UTF-8 LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8"
November 20, 201213 yr I never use winscp but im my experience one possible cause could be the two bytes at the start of the php file. UTF-8 use a header  check this http://en.wikipedia.org/wiki/UTF-8#Byte_order_mark the problem is about many editors of php or plain text don't support utf8 and delete or change that byte, another thing to think it is about the ftp can convert the utf-8 file to ascii because the end of line win \n\r mac \r unix \n for the text files, so better to use binary for php files. do small tests, there are a few combinations to check where it's the problem.
Create an account or sign in to comment