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

Cannot input non-ASCII characters when inputing a path #83

Open
iamlixiao opened this issue Jul 29, 2012 · 3 comments
Open

Cannot input non-ASCII characters when inputing a path #83

iamlixiao opened this issue Jul 29, 2012 · 3 comments

Comments

@iamlixiao
Copy link

When inputing a path (for example, pressing Enter to add a torrent) ,I can't type any non-ASCII characters by either an input method or copy-paste. It seems that rtorrent just blocks any input longer than one byte. When pressing Tab for hints, non-ASCII subfolders and torrent filenames are converted to strange strings (папка/ becomes M-PM-?M-PM-0M-PM-?M-PM-:M-PM-0/). I don't know what happens.
I guess it is caused buy some internal defects of rtorrent while I haven't read the source code.

@banderlog
Copy link

Yep, this problem exists

@gilllux
Copy link

gilllux commented Feb 24, 2013

I confirm no multi-byte chars can by inputted in rtorrent, in the load>, load_start> or command> prompts, either by IME or copy-paste. However here (rtorrent 0.8.6) autocompletion works fine: pressing tab shows multi-byte hints properly, and you can even autocomplete directories that contain multi-byte chars as long as you don't need to type them. For example if you have a directory called blah_なにか without anything else along starting with blah_, blah_<tab> allows you to input blah_なにか (however double-width chars messes up the cursor position).

@PRESFIL
Copy link

PRESFIL commented Jul 15, 2020

You can unlock other nonlatin symbol with this:

diff --git a/src/input/text_input.cc b/src/input/text_input.cc
index 1d14620..89f0722 100644
--- a/src/input/text_input.cc
+++ b/src/input/text_input.cc
@@ -47,9 +47,6 @@ TextInput::pressed(int key) {
   if (m_bindings.pressed(key)) {
     return true;

-  } else if (key >= 0x20 && key < 0x7F) {
-    Base::insert(m_pos++, 1, key);
-
   } else {
     switch (key) {
     case 0x7F:
@@ -98,7 +95,7 @@ TextInput::pressed(int key) {
       break;

     default:
-      return false;
+      Base::insert(m_pos++, 1, key);
     }
   }

but its not enough, cursor movement in ncurses is wrong.
Here you need to rewrite to unicode std:string or something to count in transparently.
May be @rakshasa tell what else I missed (maybe escaping handling will be nice to see). I'm not a professional.

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

4 participants