File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -731,8 +731,11 @@ def startTagMeta(self, token):
731
731
if "charset" in attributes :
732
732
self .parser .tokenizer .stream .changeEncoding (attributes ["charset" ])
733
733
elif "content" in attributes :
734
- data = inputstream .EncodingBytes (
735
- attributes ["content" ].encode (self .parser .tokenizer .stream .charEncoding [0 ]))
734
+ # Encoding it as UTF-8 here is a hack, as really we should pass
735
+ # the abstract Unicode string, and just use the
736
+ # ContentAttrParser on that, but using UTF-8 allows all chars
737
+ # to be encoded and as a ASCII-superset works.
738
+ data = inputstream .EncodingBytes (attributes ["content" ].encode ("utf-8" ))
736
739
parser = inputstream .ContentAttrParser (data )
737
740
codec = parser .parse ()
738
741
self .parser .tokenizer .stream .changeEncoding (codec )
You can’t perform that action at this time.
0 commit comments