Commits

Anonymous committed d742c20

Fixed issues with writing utf-8.

Comments (0)

Files changed (2)

             elif stmt in (STMT_TEXT, STMT_CEMBED) :
                 assert(isinstance(value, (str, unicode))), type(value)
                 try:
-                    ostream.write(value.encode("utf-8"))
+                    ostream.write(unicode(value, "utf-8").encode("utf-8"))
                 except UnicodeDecodeError, e:
                     raise texceptions.TemplateException(str(e), filepos)
 
                 if isinstance(res, ttypes.Null):
                     pass
                 elif isinstance(res, ttypes.String):
-                    ostream.write(res.str.encode("utf-8"))
+                    ostream.write(unicode(res.str, "utf-8").encode("utf-8"))
                 else:
                     raise texceptions.TemplateTypeException("Top level expression resulted in non-String value.", res.filepos, got=res)
 
-{
-}
-
-{
-}
+Vigenère