mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 13:06:20 -05:00
Support underscores (in addition to hyphens) for charset detection. (#10410)
This commit is contained in:
parent
5b22d5ee03
commit
8e1febc6a1
3 changed files with 18 additions and 2 deletions
|
|
@ -58,9 +58,11 @@ if TYPE_CHECKING:
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_charset_match = re.compile(br'<\s*meta[^>]*charset\s*=\s*"?([a-z0-9-]+)"?', flags=re.I)
|
||||
_charset_match = re.compile(
|
||||
br'<\s*meta[^>]*charset\s*=\s*"?([a-z0-9_-]+)"?', flags=re.I
|
||||
)
|
||||
_xml_encoding_match = re.compile(
|
||||
br'\s*<\s*\?\s*xml[^>]*encoding="([a-z0-9-]+)"', flags=re.I
|
||||
br'\s*<\s*\?\s*xml[^>]*encoding="([a-z0-9_-]+)"', flags=re.I
|
||||
)
|
||||
_content_type_match = re.compile(r'.*; *charset="?(.*?)"?(;|$)', flags=re.I)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue