summary refs log tree commit diff
path: root/tests/test_preview.py
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2021-08-03 10:34:44 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2021-08-03 10:34:44 +0100
commit11dda97e86579d807528392df7ba3c3efdd03c01 (patch)
tree003e6d55563e78ccca0e9f4a2b1c798231038370 /tests/test_preview.py
parentMerge branch 'release-v1.39' of github.com:matrix-org/synapse into matrix-org... (diff)
parentFix the `tests-done` github actions step, again (#10512) (diff)
downloadsynapse-11dda97e86579d807528392df7ba3c3efdd03c01.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'tests/test_preview.py')
-rw-r--r--tests/test_preview.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_preview.py b/tests/test_preview.py

index cac3d81ac1..48e792b55b 100644 --- a/tests/test_preview.py +++ b/tests/test_preview.py
@@ -325,6 +325,19 @@ class MediaEncodingTestCase(unittest.TestCase): ) self.assertEqual(encoding, "ascii") + def test_meta_charset_underscores(self): + """A character encoding contains underscore.""" + encoding = get_html_media_encoding( + b""" + <html> + <head><meta charset="Shift_JIS"> + </head> + </html> + """, + "text/html", + ) + self.assertEqual(encoding, "Shift_JIS") + def test_xml_encoding(self): """A character encoding is found via the meta tag.""" encoding = get_html_media_encoding(