We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1442bad commit 9d478a3Copy full SHA for 9d478a3
src/html5lib/html5parser.py
@@ -731,8 +731,11 @@ def startTagMeta(self, token):
731
if "charset" in attributes:
732
self.parser.tokenizer.stream.changeEncoding(attributes["charset"])
733
elif "content" in attributes:
734
- data = inputstream.EncodingBytes(
735
- attributes["content"].encode(self.parser.tokenizer.stream.charEncoding[0]))
+ # Encoding it as UTF-8 here is a hack, as really we should pass
+ # 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"))
739
parser = inputstream.ContentAttrParser(data)
740
codec = parser.parse()
741
self.parser.tokenizer.stream.changeEncoding(codec)
0 commit comments