diff --git a/CHANGES b/CHANGES index 820c06931..4260cffdb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ 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. diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py index 62a55ee89..df01aaa54 100644 --- a/sphinx/builders/qthelp.py +++ b/sphinx/builders/qthelp.py @@ -12,6 +12,7 @@ import os import re import cgi +import codecs from os import path from docutils import nodes @@ -28,7 +29,7 @@ _idpattern = re.compile( # 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'''\ @@ -50,7 +51,7 @@ collection_template = '''\ # 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'''\ %(outname)s.org.%(outname)s.%(nversion)s @@ -109,7 +110,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder): 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') try: f.write(collection_template % {'outname': outname}) finally: @@ -161,7 +162,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder): 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') try: nversion = self.config.version.replace('.', '_') nversion = nversion.replace(' ', '_')