Commit d704be9b authored by Paolo Borelli's avatar Paolo Borelli

I utf8

parent 68c62dfd
2006-02-13 Steve Frécinaux <steve@istique.net>
* plugins/externaltools/tools/capture.py: convert to unicode the
what we get from the pipe.
2006-02-13 Paolo Borelli <pborelli@katamail.com>
* gedit/gedit-ui.xml: add placeholders in the File menu in case
......
......@@ -99,14 +99,23 @@ class Capture(gobject.GObject):
def on_output(self, source, condition):
line = source.readline()
if len(line) > 0:
try:
line = unicode(line, 'utf-8')
except:
line = unicode(line,
locale.getdefaultlocale()[1],
'replace')
if source == self.pipe.stdout:
self.emit('stdout-line', line)
else:
self.emit('stderr-line', line)
return True
return False
def stop(self, error_code = -1):
if self.pipe is not None:
os.kill(self.pipe.pid, signal.SIGTERM)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment