Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with UTF-8 correctly? #11

Closed
Janiczek opened this issue Mar 16, 2012 · 5 comments
Closed

Doesn't work with UTF-8 correctly? #11

Janiczek opened this issue Mar 16, 2012 · 5 comments
Assignees

Comments

@Janiczek
Copy link

I've got a buffer with UTF-8 characters (acutes, carons, ...) and I'm trying to send it to tmux session. I've connected successfully, but when I send it, Python interpreter screams. When I write it directly into the interpreter, it behaves OK, but when I send it from Vim, it (the interpreter) gives an error:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: invalid continuation byte

What to do?

Here's my buffer in Vim: (note the á,í,ý,č,ů etc. characters)

class Tovarna:
  # Továrna.
  # Zde definujeme, kolik má fréz, rýsovačů, zámečníků, atd. - tedy "threads".
  pass

class Zakazka:
  # Nová zakázka.
  # Je třeba po vytvoření ještě předat továrně skrze TODO.
  # Zde definujeme časové deadlines a z jakých sestav se skládá.
  pass

class Sestava:
  # Sestava.
  # Zde definujeme, kolikrát je sestava třeba vyrobit a z čeho se skládá.
  # Může obsahovat sestavu nebo položku.
  pass

class Polozka:
  # Položka - nejnižší prvek, "součástka". Dále už se nenoří.
  pass
@jpalardy
Copy link
Owner

I've tried to configure myself UTF-8 all the way: terminal, file formats, and Vim.

That being said… I've just tried to send Japanese characters from Vim to tmux and … yeah, it doesn't work.

There are many moving pieces at play: vimscript, shelling out, tmux. Let me investigate this.

@ghost ghost assigned jpalardy Mar 16, 2012
@Janiczek
Copy link
Author

Let me know if I can help somehow.

Environment:

  • Mac OS X 10.7
  • iTerm 2 1.0.0.20120203
  • Vim 7.3.410
  • tmux 1.6
  • vim-slime - HEAD of this repo

@jpalardy
Copy link
Owner

Ah, the tmux code uses "send-keys" in a way it wasn't intended…

I tried the screen code and it's working fine. But it does have a different purpose, to send a "string". Meanwhile, "send-keys" was meant to send control keys to tmux.

I found a workaround with "set-buffer" and "paste-buffer".

https://github.com/kikijump/tslime.vim/blob/master/tslime.vim

I'll work on it overnight unless you want to test it and send me a pull-request.

jpalardy added a commit that referenced this issue Mar 17, 2012
allows for better transport, in particular utf-8 (issue #11)
@jpalardy
Copy link
Owner

This one is working for me.

Can you confirm?

@Janiczek
Copy link
Author

Works beautifully. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants