File tree Expand file tree Collapse file tree 7 files changed +16
-4
lines changed Expand file tree Collapse file tree 7 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 11Release 0.6.2 (in development)
22==============================
33
4+ * Set the default encoding to ``utf-8-sig`` to handle files with a
5+ UTF-8 BOM correctly.
6+
47* #178: apply ``add_function_parentheses`` config value to C
58 functions as promised.
69
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ General configuration
7777.. confval :: source_encoding
7878
7979 The encoding of all reST source files. The recommended encoding, and the
80- default value, is ``'utf-8' ``.
80+ default value, is ``'utf-8-sig ' ``.
8181
8282 .. versionadded :: 0.5
8383 Previously, Sphinx accepted only UTF-8 encoded sources.
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class Config(object):
3737
3838 master_doc = ('contents' , 'env' ),
3939 source_suffix = ('.rst' , 'env' ),
40- source_encoding = ('utf-8' , 'env' ),
40+ source_encoding = ('utf-8-sig ' , 'env' ),
4141 unused_docs = ([], 'env' ),
4242 exclude_dirs = ([], 'env' ),
4343 exclude_trees = ([], 'env' ),
Original file line number Diff line number Diff line change 5252 'cloak_email_addresses' : True ,
5353 'pep_base_url' : 'http://www.python.org/dev/peps/' ,
5454 'rfc_base_url' : 'http://tools.ietf.org/html/' ,
55- 'input_encoding' : 'utf-8' ,
55+ 'input_encoding' : 'utf-8-sig ' ,
5656 'doctitle_xform' : False ,
5757 'sectsubtitle_xform' : False ,
5858}
Original file line number Diff line number Diff line change 1+ File with UTF-8 BOM
2+ ===================
3+
4+ This file has a UTF-8 "BOM".
5+
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ Contents:
1717 includes
1818 markup
1919 desc
20+ bom
2021 math
2122 autodoc
2223 autosummary
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def teardown_module():
4141 %(root)s/images.txt:9: WARNING: image file not readable: foo.png
4242%(root)s/images.txt:23: WARNING: nonlocal image URI found: \
4343 http://www.python.org/logo.png
44- %(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8' used for reading \
44+ %(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8-sig ' used for reading \
4545 included file u'wrongenc.inc' seems to be wrong, try giving an :encoding: option
4646%(root)s/includes.txt:56: WARNING: download file not readable: nonexisting.png
4747"""
@@ -115,6 +115,9 @@ def teardown_module():
115115 ".//div[@class='footer']" : 'Georg Brandl & Team' ,
116116 ".//a[@href='http://python.org/']" : '' ,
117117 },
118+ 'bom.html' : {
119+ ".//title" : " File with UTF-8 BOM" ,
120+ },
118121 '_static/statictmpl.html' : {
119122 ".//project" : 'Sphinx <Tests>' ,
120123 },
You can’t perform that action at this time.
0 commit comments