Hi!

When using unicode text from python with edje, it needs to be passed as
a UTF-8 encoded string. To avoid doing this in the application, it
should be handled in the bindings.

Jan Lübbe

---
 edje/edje.c_edje_object.pxi |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/edje/edje.c_edje_object.pxi b/edje/edje.c_edje_object.pxi
index 0f4da68..21c237e 100644
--- a/edje/edje.c_edje_object.pxi
+++ b/edje/edje.c_edje_object.pxi
@@ -391,17 +391,20 @@ cdef public class Edje(evas.c_evas.Object) [object
PyEdje, type PyEdje_Type]:
         else:
             raise TypeError("func must be callable or None")
 
-    def part_text_set(self, char *part, char *text):
-        edje_object_part_text_set(self.obj, part, text)
+    def part_text_set(self, char *part, text):
+        cdef char *s
+        u = text.encode("utf8")
+        s = u
+        edje_object_part_text_set(self.obj, part, s)
 
     def part_text_get(self, char *part):
-        "@rtype: str"
+        "@rtype: unicode"
         cdef char *s
         s = edje_object_part_text_get(self.obj, part)
         if s == NULL:
             return None
         else:
-            return s
+            return s.decode("utf8")
 
     def part_swallow(self, char *part, c_evas.Object obj):
         """Swallows an object into the edje





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to