Code

fix replace to work with non-ascii text
authorbuliabyak <buliabyak@users.sourceforge.net>
Sun, 15 Jul 2007 05:39:21 +0000 (05:39 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sun, 15 Jul 2007 05:39:21 +0000 (05:39 +0000)
share/extensions/text_replace.py

index 3ea665970ba6d27314bf5997c6975c76480dc3bd..73b562743fd0a51cd9c82fec886e35f1521282cd 100644 (file)
@@ -10,7 +10,7 @@ class C(chardataeffect.CharDataEffect):
     fr = self.options.from_text.strip('"').replace('\$','$')\r
     to = self.options.to_text.strip('"').replace('\$','$')\r
 \r
-    return (text.replace(fr, to))\r
+    return (text.replace(unicode(fr,"utf-8"), unicode(to,"utf-8")))\r
 \r
 c = C()\r
 c.affect()\r