1. Luke Plant
  2. sphinx


Georg Brandl  committed 578147f

#232: Support non-ASCII metadata in Qt help builder.

  • Participants
  • Parent commits c45e790
  • Branches default

Comments (0)

Files changed (2)


View file
  • Ignore whitespace
 Release 0.6.3 (in development)
+* #232: Support non-ASCII metadata in Qt help builder.
 * Properly format bullet lists nested in definition lists for LaTeX.
 * Section titles are now allowed inside ``only`` directives.

File sphinx/builders/qthelp.py

View file
  • Ignore whitespace
 import os
 import re
 import cgi
+import codecs
 from os import path
 from docutils import nodes
 # It contains references to compressed help files which should be
 # included in the collection.
 # It may contain various other information for customizing Qt Assistant.
-collection_template = '''\
+collection_template = u'''\
 <?xml version="1.0" encoding="utf-8" ?>
 <QHelpCollectionProject version="1.0">
 # It contains the table of contents, indices and references to the
 # actual documentation files (*.html).
 # In addition it defines a unique namespace for the documentation.
-project_template = '''\
+project_template = u'''\
 <?xml version="1.0" encoding="UTF-8"?>
 <QtHelpProject version="1.0">
     def build_qhcp(self, outdir, outname):
         self.info('writing collection project file...')
-        f = open(path.join(outdir, outname+'.qhcp'), 'w')
+        f = codecs.open(path.join(outdir, outname+'.qhcp'), 'w', 'utf-8')
             f.write(collection_template % {'outname': outname})
         projectfiles = '\n'.join(projectfiles)
         # write the project file
-        f = open(path.join(outdir, outname+'.qhp'), 'w')
+        f = codecs.open(path.join(outdir, outname+'.qhp'), 'w', 'utf-8')
             nversion = self.config.version.replace('.', '_')
             nversion = nversion.replace(' ', '_')