[Featureserver] fix for unicode html output

Dan Lipsitt danlipsitt at gmail.com
Thu Jan 17 18:11:15 EST 2008


Currently the html service tries to convert features to strings, and
then convert to UTF-8. If the feature contains non-ascii chars, the
call to str() will fail. The patch below fixes this issue.

Dan

===================================================================
--- HTML.py	(revision 423)
+++ HTML.py	(working copy)
@@ -17,7 +17,7 @@
     def encode(self, result):
         template = self.template()
         output = Template(template, searchList = [{'actions':result}, self])
-        return "text/html; charset=utf-8", str(output).decode("utf-8")
+        return "text/html; charset=utf-8", unicode(output)

     def template(self):
         datasource = self._datasource()



More information about the Featureserver mailing list