Allow specifying charset and/or improve charset detection
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Tái hiện trường hợp HTML được cung cấp và lần theo đường dẫn phát hiện charset được sử dụng với Heuristics.ALL; issue không nêu tên tệp mã nguồn hoặc các bài kiểm thử. Xác định cách các bên gọi chỉ định một charset đã biết và cách phát hiện UTF-8 cần hoạt động, sau đó xác minh cả hai trường hợp bằng kiểm thử hồi quy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Currently the only way to specify the charset is in the document (with BOM or <meta charset=); if the charset is known but not specified in the document, there is no way to specify it.
Additionally, charset detection even with Heuristics.ALL does not always work well; in particular, it fails to recognize UTF-8 at least if the first non-ASCII byte is late in the document. The WHATWG spec recommends that systems are able to recognize UTF-8 even if they arenʼt good at other charsets (as a non-normative note)
The UTF-8 encoding has a highly detectable bit pattern. Files from the local file system that contain bytes with values greater than 0x7F which match the UTF-8 pattern are very likely to be UTF-8, while documents with byte sequences that do not match it are very likely not. When a user agent can examine the whole file, rather than just the preamble, detecting for UTF-8 specifically can be especially effective. [PPUTF8] [UTF8DET]
(This is reproduced with multiple test documents; the smallest is below but another one output the warning method that the UTF-8 character was invalid in Windows-1252, meaning that went with the default which was a particularly bad guess)
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://fred-wang.github.io/mathml.css/mathml.css">
<title>Circle equation</title>
<!-- <meta charset="utf-8" /> -->
</head>
<body>
<p>
The equation
<math display=inline>
<mi>y</mi><mo>=</mo><mo>±</mo>
<msqrt>
<msup><mi>r</mi><mn>2</mn></msup>
<mo>-</mo>
<msup><mi>x</mi><mn>2</mn></msup>
</msqrt>
</math>
produces a circle with radius <math display=inline><mi>r</mi></math>:
</p>
<svg width="10em" height="10em" viewBox="0 0 100 100">
<desc>A circle</desc>
<circle cx="50" cy="50" r="40" fill="none" stroke="blue" stroke-width="1" />
</svg>
</body>
</html>
- Ngôn ngữ chính
- Java
- Star
- 65
- Fork
- 29
- Merge trung bình
- 11 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của validator/htmlparser
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
validator/htmlparser#98 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
validator/htmlparser#96 · 1 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
validator/htmlparser#95 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
validator/htmlparser#87 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
validator/htmlparser#60 ·
Tất cả issue của validator/htmlparser
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
checkstyle/test-configs#263 ·
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Cannot differ own consent and managed consents in My Consents view and detailed consent view. Đang mở1.0.0-alpha2 Type/Improvement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
wso2/dpdp-accelerator#272 ·