{"id":189,"date":"2011-07-21T14:54:29","date_gmt":"2011-07-21T13:54:29","guid":{"rendered":"http:\/\/mod16.org\/hurfdurf\/?p=189"},"modified":"2012-03-02T17:45:19","modified_gmt":"2012-03-02T16:45:19","slug":"the-ssh-client-in-macos-x-10-7-lion-has-broken-utf8-support","status":"publish","type":"post","link":"https:\/\/mod16.org\/hurfdurf\/?p=189","title":{"rendered":"The SSH client in MacOS X 10.7 (Lion) has broken(?) UTF8 support"},"content":{"rendered":"<p>I upgraded to 10.7 today, only to find that my IRC client (Irssi running in a screen on a remote server) suddenly had decided that it hated any and all non-ASCII characters, replacing them with ?&#8217;s instead. In the local terminal everything worked just fine. I use UTF-8 as the terminal charset on both the server and in the OS X terminal, and everything had worked just fine prior to the upgrade, both on the Mac, on my Windows box (using PuTTY) and on various other Unix machines.<\/p>\n<p>I eventually traced the problem to the OS X built-in ssh client (<tt>\/usr\/bin\/ssh<\/tt>), which for some reason badly mishandles UTF-8 in Lion. There are <del>two<\/del> three possible workarounds:<\/p>\n<ol>\n<li>install a different SSH client (OpenSSH installed via MacPorts is a good alternative), or<\/li>\n<li>do everything on the remote server in a screen launched with the <tt>-U<\/tt> flag. The <tt>defencoding<\/tt> and <tt>defutf8<\/tt> flags in your <tt>screenrc<\/tt> will not help.<\/li>\n<li>new solution, reported to work but not tested by me: edit \/etc\/ssh_config and remove the LC_* part from the line that says <tt>SendEnv LANG LC_*<\/tt>.<\/li>\n<\/ol>\n<p>A very late update, March 2012: the third solution is probably the best. Either remove the LC_* part, or comment out the entire line. The comments on this article have some more relevant information about why this is the correct solution; comments #21 and #22 are particularly helpful. Thank you, internet!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I upgraded to 10.7 today, only to find that my IRC client (Irssi running in a screen on a remote server) suddenly had decided that it hated any and all non-ASCII characters, replacing them with ?&#8217;s instead. In the local terminal everything worked just fine. I use UTF-8 as the terminal charset on both the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry","category-the-internet"],"_links":{"self":[{"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=189"}],"version-history":[{"count":6,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/posts\/189\/revisions"}],"predecessor-version":[{"id":199,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/posts\/189\/revisions\/199"}],"wp:attachment":[{"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}