[gedit] tools: convert bytes to text



commit e9a4d8aa502fa35d3698e69887fbd6bb7e5d81b3
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Apr 2 09:24:04 2013 +0200

    tools: convert bytes to text

 plugins/externaltools/tools/capture.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/externaltools/tools/capture.py b/plugins/externaltools/tools/capture.py
index c2609c5..c3015a1 100644
--- a/plugins/externaltools/tools/capture.py
+++ b/plugins/externaltools/tools/capture.py
@@ -170,13 +170,13 @@ class Capture(GObject.Object):
 
             if len(line) > 0:
                 try:
-                    line = line
+                    line = line.decode('utf-8')
                 except:
-                    line = line.encode(locale.getdefaultlocale()[1])
+                    line = line.decode(locale.getdefaultlocale()[1])
 
                 self.read_buffer += line
                 lines = self.read_buffer.splitlines(True)
-                
+
                 if not lines[-1].endswith("\n"):
                     self.read_buffer = lines[-1]
                     lines = lines[0:-1]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]