Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0be0ab commit 8a34597Copy full SHA for 8a34597
1 file changed
selfspy/sniff_x.py
@@ -178,7 +178,12 @@ def get_wm_name(self, win):
178
if r:
179
return r.decode('latin1') # WM_NAME with type=STRING.
180
else:
181
- return d.value.decode('utf8')
+ # Fixing utf8 issue on Ubuntu (https://github.com/gurgeh/selfspy/issues/133)
182
+ # Thanks to https://github.com/gurgeh/selfspy/issues/133#issuecomment-142943681
183
+ try:
184
+ return d.value.decode('utf8')
185
+ except UnicodeError:
186
+ return d.value.encode('utf8').decode('utf8')
187
188
def get_cur_window(self):
189
i = 0
0 commit comments