[Telepathy-commits] [telepathy-spec/master] doc-generator.py: cope with non-ASCII characters in the spec

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Mar 20 08:39:41 PDT 2009


Collabora ♥ Unicode
---
 tools/doc-generator.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/doc-generator.py b/tools/doc-generator.py
index 5b369d0..21d5c51 100755
--- a/tools/doc-generator.py
+++ b/tools/doc-generator.py
@@ -71,14 +71,14 @@ for interface in spec.interfaces:
     
     # open the output file
     out = open(os.path.join(output_path, '%s.html' % interface.name), 'w')
-    print >> out, t
+    print >> out, unicode(t).encode('utf-8')
     out.close()
 
 # write out a TOC
 template_def = load_template('index.html')
 t = Template(template_def, namespaces=[spec])
 out = open(os.path.join(output_path, 'index.html'), 'w')
-print >> out, t
+print >> out, unicode(t).encode('utf-8')
 out.close()
 
 # write out the generic types
@@ -86,7 +86,7 @@ namespace = { 'spec': spec }
 template_def = load_template('generic-types.html')
 t = Template(template_def, namespaces=namespace)
 out = open(os.path.join(output_path, 'generic-types.html'), 'w')
-print >> out, t
+print >> out, unicode(t).encode('utf-8')
 out.close()
 
 # write out the errors
@@ -94,7 +94,7 @@ namespace = { 'spec': spec }
 template_def = load_template('errors.html')
 t = Template(template_def, namespaces=namespace)
 out = open(os.path.join(output_path, 'errors.html'), 'w')
-print >> out, t
+print >> out, unicode(t).encode('utf-8')
 out.close()
 
 # write out the fullindex
@@ -102,5 +102,5 @@ namespace = { 'spec': spec }
 template_def = load_template('fullindex.html')
 t = Template(template_def, namespaces=namespace)
 out = open(os.path.join(output_path, 'fullindex.html'), 'w')
-print >> out, t
+print >> out, unicode(t).encode('utf-8')
 out.close()
-- 
1.5.6.5




More information about the telepathy-commits mailing list