]> git.llucax.com Git - software/pymin.git/commitdiff
Convert to unicode before encoding to UTF-8 in firewall template (fixes #16).
authorLeandro Lucarella <llucax@gmail.com>
Sun, 11 May 2008 16:23:36 +0000 (13:23 -0300)
committerLeandro Lucarella <llucax@gmail.com>
Sun, 11 May 2008 16:23:36 +0000 (13:23 -0300)
pymin/services/firewall/templates/iptables.sh

index 80f4a323995ffe7eb9331a0e35bfed4b5e1656ce..e384d0ed36c38e267ff6461589d20119b3e9f347 100644 (file)
@@ -4,7 +4,7 @@
 
 # TODO escape shell commands more securely
 def s(text):
 
 # TODO escape shell commands more securely
 def s(text):
-    return repr(text.encode('utf-8'))
+    return repr(unicode(text).encode('utf-8'))
 
 def optional(switch, value):
     if value is not None:
 
 def optional(switch, value):
     if value is not None: