Vim. Can't yank non-eng chars to system clipboard

Viewed 143

When I yank russian characters, say тест, to system clipboard ("+y) and then paste it in a shell or a browser I get this —Ç–µ—Å—Ç. How to fix this?

Vim

:set encoding?
encoding=utf-8
:set fileencoding
fileencoding=utf-8

Shell

echo $LC_CTYPE
UTF-8
2 Answers

Setting correct locale for a shell with these lines added to .zshenv solves the issue.

set -a
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8
set +a

Related