From 2 days ago, when I enter ls in iTerm2(also default terminal app), directories I created are shown like '0. PCR', and Korean filenames are shown as ''$'\355\225\234\352\270\200''.txt'.

enter image description here

In finder windows, all filenames are correctly shown in Korean letters

enter image description here

but in terminal, Korean files are shown like above. I use zsh and oh-my-zsh and I've tried to find similar issues in internet but I cannot find same case. Are there anybody who can describe why this happen and how to fix?

  • ls in my Debian prints this filename in Korean (my LANG is pl_PL.UTF-8). However LC_ALL=C ls --quoting-style=shell-escape replicates the issue. – Kamil Maciorowski Jun 18 '18 at 11:37
  • Is this problem occurring locally, or are you connecting to a non-macOS system via SSH? – grawity Jun 18 '18 at 14:51
  • grawity: it happened on my MacBook Pro. Thanks a lot for your trying to help ^^ – Dmaj7 Jun 18 '18 at 16:22
  • Kamil : Based on your explanation, I set some locale info on my .zshrc and .inputrc .. after that, the broken Korean filenames are fixed. but this time, "LS_COLOR" doesn't work. Basically I use OMZsh.. I think some config settings are broken after deleting zsh-templates-osx due to updating errors using MacPorts. Thanks a lot ! ^^ – Dmaj7 Jun 18 '18 at 16:27

I fixed it after adding two things.

  1. in my ~/.zshrc

    export LANG=en_US.UTF-8
    export LC_CTYPE=en_US.UTF-8
  2. in my ~/.inputrc

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

Thank you Kamil and Grawity for your kind comments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.