0

The system is Ubuntu 14.04 LTS, has been running for a long time without problems.

Recently I found that the file names (Chinese characters) become garbage (wrong encoding). To be exact: I ssh from a Linux Mint PC, type ls and got file names with lots of '????'. Nobody has done anything with the files.

I used the bash script in the accepted answer of https://askubuntu.com/questions/113188/character-encoding-problem-with-filenames-find-broken-filenames with no luck. However, the name printed by

# display the filename converted from each enc to utf8
printf 'In %s:\n' "$dir/"

is OK (correctly decoded), only on iconv there are always errors with all the encoding such as UTF XX, Windows 12XX, CP xx, GB xx

Also to my surprise, whebn I rsync the remote Ubuntu folder to my local Linux Mint PC, the file names are correct!

What went wrong?

6
  • Is your terminal emulator on Linux Mint correctly set to work with UTF-8?
    – Daniel B
    Oct 10, 2014 at 8:27
  • Yes indeed, I can see my local folder in Chinese too
    – cpliu338
    Oct 10, 2014 at 8:48
  • I see. In any case, it’s likely a display issue with your SSH session.
    – Daniel B
    Oct 10, 2014 at 9:37
  • Strange indeed. I tried with yet another PC with Linux Mint (same qiana), which works correctly! The two Linux Mint computers are both installed by me, same version, same "terminal" program, in the menu Terminal | Set character encoding both show UTF-8.
    – cpliu338
    Oct 10, 2014 at 11:16
  • HTTP is yet another location where encoding issues are extremely likely. JSON, for example, relies entirely on what the HTTP headers say.
    – Daniel B
    Oct 10, 2014 at 11:27

1 Answer 1

0

My Linux Mint has env LANG=ZH-TW UTF-8, I changed it to LANG="en_us.UTF-8" and solved the problem. But I still think the terminal emulator should have fixed encoding problem when I chose UTF-8 in the menu.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .