0

I have a file that emacs correctly displays on mac. When I cat or less the file in mac terminal I see garbled characters such as "?E?u?@?@?@?@?@?@?@?". Running chardetect indicates SHIFT-JIS.

I tried adding the following to ~./bashrc but still see the same output.

export LANG=ja_JP.SHIFT_JIS
export LC_ALL=ja_JP.SHIFT_JIS

Under encodings in preferences for terminal, all encodings are checked including the Japanese ones. Am I missing some other method here for viewing these files? I can see other files with Japanese characters in the mac terminal.

user11020868
  • 405
  • 1
  • 5
  • 11

1 Answers1

0

You need to change the text encoding at the Advanced tab in profile preferences to make Terminal use different encoding. Terminal profile preferences

Env vars (LANG, LC_ALL) only affect the shell and child processes.

Also note that some characters from Windows cannot be displayed (①,髙,Ⅰ (roman digit) etc).

criticabug
  • 331
  • 6
  • 12
  • For iTerm2, `Preferences` > `Profiles` > `Terminal` > `Character encoding` > `Japanese (Shift JIS)`. – ynn Jan 26 '23 at 16:23