mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 08:28:39 +00:00
Fix unicode support in console ui (#1307)
This commit is contained in:
parent
c06f905702
commit
81a837faed
1 changed files with 6 additions and 14 deletions
|
@ -308,7 +308,7 @@ class Screen(CursesStdIO):
|
|||
if c == curses.KEY_ENTER or c == 10:
|
||||
if self.input:
|
||||
self.add_line(">>> " + self.input)
|
||||
self.command_parser(self.input)
|
||||
self.command_parser(self.input.encode(self.encoding))
|
||||
if len(self.input_history) == INPUT_HISTORY_SIZE:
|
||||
# Remove the oldest input history if the max history size
|
||||
# is reached.
|
||||
|
@ -404,20 +404,12 @@ class Screen(CursesStdIO):
|
|||
if c > 31 and c < 256:
|
||||
# Emulate getwch
|
||||
stroke = chr(c)
|
||||
|
||||
uchar = None
|
||||
|
||||
while 1:
|
||||
uchar = ""
|
||||
while not uchar:
|
||||
try:
|
||||
uchar = stroke.decode(self.encoding)
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
|
||||
c = self.stdscr.getch()
|
||||
|
||||
if c == -1:
|
||||
break
|
||||
|
||||
stroke += chr(c)
|
||||
|
||||
if uchar:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue