OS X Terminal UTF-8 issues

后端 未结 11 2242
忘了有多久
忘了有多久 2020-11-27 14:56

Okay, so I finally got myself a MacBook Air after 15 years of linux. And before I got it my big concern was UTF-8 support because no matter if I get files sent to me from wi

11条回答
  •  粉色の甜心
    2020-11-27 15:21

    Unfortunately, the Preferences dialog is not always very helpful, but by tweaking around you should be able to get everything working.

    To be able to type Swedish characters in Terminal, add the following lines to your ~/.inputrc (most likely you must create this file):

    set input-meta on
    set output-meta on
    set convert-meta off
    

    This should do the work both with utf8 and other codings in bash, nano and many other programs. Some programs, like tmux, also depends on the locale. Then, adding for instance export LC_ALL=en_US.UTF-8 to your ~/.profile file should help, but keep in mind that a few (mainly obscure) programs require a standard locale, so if you have trouble running or compiling a program, try going back to LC_ALL=C.

    Some references that may be helpful:

    • http://homepage.mac.com/thgewecke/mlingos9.html#unicode
    • http://hints.macworld.com/article.php?story=20060825071728278

提交回复
热议问题