We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
2 parents38e27a7 +9d478a3 commita32c604Copy full SHA for a32c604
src/html5lib/html5parser.py
@@ -731,8 +731,11 @@ def startTagMeta(self, token):
731
if"charset"inattributes:
732
self.parser.tokenizer.stream.changeEncoding(attributes["charset"])
733
elif"content"inattributes:
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)