2015年6月19日星期五

UTF-8 handling on Mac OS X terminals

Ran into something strange today. I ssh'ed from my new shiny MacBook Pro to my old desktop, where I have some files with names containing Chinese characters. All Chinese characters were presented as question marks when I ran ls.

Been Googling a bit before I realised that locale settings are different on these two platforms. I added the following two lines into ~/.bash_profile on my OS X and everything then became familiar again.

export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8

没有评论:

发表评论