2

I can't copy Non-ASCII charaters from Neovim anymore when I select them with mouse or crtl + v.

For example, I have the Turkish word Bankası written in my editor. When I yank and paste it to somewhere else, what I see is Bankasƒ±.

In my nvimrc I only have:

if has('mouse')
  set mouse=a
end
set clipboard=unnamed

I have tried setting

  1. mouse=r
  2. mouse=v
  3. clipboard=unnamedplus

but no luck and I can't seem to remember what's changed. Any idea how to fix this?

Additional info for comments:

how do you copy exactly? What clipboard provider are you using? Have you tried a different one?

I have tried both yy and cmdc.

Healthcheck does tell me, I use pbcopy and all is OK.

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

No, I haven't tried anything else. I didn't know there was such an option other than pbcopy.

Can you check the encoding settings of all apps? Is the character double-width in some way?

Other apps work fine. I can copy from VS Code to any other app just fine.

I don't know if it is double-width or not. It's a standard Turkish char that didn't cause any problems before.

5
  • You said it doesn't work anymore so that could be a change in your config, so you might want to read How to debug my vimrc. It the problem doesn't come from your vimrc maybe you should try with another terminal emulator too.
    – statox
    Jun 25, 2020 at 14:48
  • Sorry for not being clear. It cannot be plug-in related because I have restarted from scratch and all I have is those 4 lines in my vimrc.
    – ogirginc
    Jun 25, 2020 at 15:25
  • 2
    how do you copy exactly? What clipboard provider are you using? Have you tried a different one? Jun 25, 2020 at 20:30
  • Can you check the encoding settings of all apps? Is the character double-width in some way?
    – D. Ben Knoble
    Jun 25, 2020 at 23:36
  • Hi Christian Brabandt and D. Ben Knoble. I tried to add the info you have asked.
    – ogirginc
    Jun 28, 2020 at 16:33

1 Answer 1

1

Solution

Setting LANG to tr_TR.UTF-8 did solve the issue.

export LANG=tr_TR.UTF-8

Problem

Turns out LANG being empty was the root cause:

> locale
LANG=""
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

I only checked through AppleLocale

> defaults read -g AppleLocale
en_TR

and assumed en_TR is a valid. However locale -a doesn't list such a thing. Don't know why AppleLocale is set as en_TR neither. 🤷‍♂️

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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