Commit a955f96 1 parent c69770f commit a955f96 Copy full SHA for a955f96
File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ Features
7
7
* New ``TAG_PAGES_TITLES`` and ``CATEGORY_PAGES_TITLES`` options
8
8
(Issue #1962)
9
9
10
+ Bugixes
11
+ -------
12
+
13
+ * Set UTF-8 charset in Content-Type or text/* and *+xml (Issue #1966)
14
+
10
15
New in v7.6.4
11
16
=============
12
17
Original file line number Diff line number Diff line change @@ -242,7 +242,10 @@ def send_head(self):
242
242
f .seek (0 )
243
243
244
244
self .send_response (200 )
245
- self .send_header ("Content-type" , ctype )
245
+ if ctype .startswith ('text/' ) or ctype .endswith ('+xml' ):
246
+ self .send_header ("Content-Type" , "{0}; charset=UTF-8" .format (ctype ))
247
+ else :
248
+ self .send_header ("Content-Type" , ctype )
246
249
if os .path .splitext (path )[1 ] == '.svgz' :
247
250
# Special handling for svgz to make it work nice with browsers.
248
251
self .send_header ("Content-Encoding" , 'gzip' )
You can’t perform that action at this time.
0 commit comments