Fixing wide character related bugs

This commit is contained in:
jstenar
2007-10-30 20:42:59 +00:00
parent 4cc7d71026
commit 6aec219578
4 changed files with 10 additions and 4 deletions
+4
View File
@@ -1,3 +1,7 @@
2007-10-30 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu>
* Fixing console.title to work with wide characters
* Fixing wide character bug for log_sock
2007-10-30 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu>
* Add tests for history buffer. Add ignore_leading_spaces option for
history searches for forward_search_history, and reverse_search_history.
+3 -1
View File
@@ -553,7 +553,7 @@ class Console(object):
if txt:
self.SetConsoleTitleW(txt)
else:
buffer = c_buffer(200)
buffer = create_unicode_buffer(200)
n = self.GetConsoleTitleW(buffer, 200)
if n > 0:
return buffer.value[:n]
@@ -596,6 +596,8 @@ class Console(object):
# add the functions from the dll to the class
for func in funcs:
setattr(Console, func, getattr(windll.kernel32, func))
windll.kernel32.SetConsoleTitleW.argtypes=[c_wchar_p]
windll.kernel32.GetConsoleTitleW.argtypes=[c_wchar_p,c_short]
from event import Event
+2 -2
View File
@@ -36,9 +36,9 @@ def log_sock(s,event_type=None):
pass
else:
if event_type is None:
logsocket.sendto(s,(host,port))
logsocket.sendto(str(s),(host,port))
elif event_type in show_event:
logsocket.sendto(s,(host,port))
logsocket.sendto(str(s),(host,port))
else:
pass
+1 -1
View File
@@ -81,7 +81,7 @@ class EmacsMode(basemode.BaseMode):
dispatch_func = self.key_dispatch.get(keyinfo,default)
log("readline from keyboard:%s,%s"%(keyinfo,dispatch_func))
log_sock("%s|%s"%(format(keyinfo),dispatch_func.__name__),"bound_function")
log_sock(("%s|%s"%(format(keyinfo),dispatch_func.__name__)).encode(sys.stdout.encoding),"bound_function")
r = None
if dispatch_func:
r = dispatch_func(event)