utf-8 characters in emacs (only in term/ansi-term/multi-term) do not appear

3

1

I cannot for the life of me get utf-8 characters to appear correctly in emacs term mode on osx. They either appear as empty spaces or "<00e3><0081><00af>". I can view them in text buffers fine. I have the following in my .emacs:

(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)

I've also tried switching fonts, but to no avail. Does any one have any suggestions? I don't have any problems with the identical setup in Ubuntu. Does this have anything to do with the fact that I'm using zsh?

jshou

Posted 2013-01-18T19:11:40.660

Reputation: 131

Can you show the value of variable (describe-variable 'default-terminal-coding-system)? – artscan – 2013-01-25T09:12:35.430

The valuable of the variable (describe-variable 'default-terminal-coding-system) is "utf-8" – jshou – 2013-01-25T19:20:57.300

In *terminal* buffer I have the value of command echo $TERM - eterm-color. And I have directory ~/.terminfo/e/ and the files eterm-color* are there. What about your config? – artscan – 2013-01-26T04:56:27.143

My term was xterm-256color, but I switched to eterm-color just to see what would happen, but nothing has changed. It seems that I can actually type utf-8 characters and have them show up in term, but there are some utf-8 characters in the zsh prompt string that will not show up. Is that a different issue? – jshou – 2013-01-28T16:40:04.873

Answers

4

Try setting these values in your .zshenv

export LANG='en_US.UTF-8'
export LC_ALL="en_US.UTF-8"

It can be a source of errors since in Linux distributions the correct values use lowercase utf (e.g. en_US.utf-8)

To view all available locales use locale -a

Francisco

Posted 2013-01-18T19:11:40.660

Reputation: 1 250