changeset 614:d16da6e739ef

fix problem with utf8ify trying to encode ints.
author casties
date Mon, 21 Oct 2013 10:36:54 +0200
parents c57d80a649ea
children d6eca930a534 3f9b42840901
files SrvTxtUtils.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/SrvTxtUtils.py	Thu Oct 17 16:25:39 2013 +0200
+++ b/SrvTxtUtils.py	Mon Oct 21 10:36:54 2013 +0200
@@ -22,7 +22,7 @@
 
 import xml.etree.ElementTree as ET
 
-srvTxtUtilsVersion = "1.12.1"
+srvTxtUtilsVersion = "1.12.2"
 
 map_months = {'en': [u"",
                u"January",
@@ -84,8 +84,10 @@
         return ""
     if isinstance(s, str):
         return s
+    elif isinstance(s, unicode):
+        return s.encode('utf-8')
     else:
-        return s.encode('utf-8')
+        return str(s)
 
 def getText(node, recursive=0):
     """returns all text content of a (etree) node and its subnodes"""