Meta Charset First-1024-Bytes Check
Checks a supplied meta charset declaration and its exclusive ending byte offset against the first 1024 bytes rule. Byte positions must come from the original encoded HTML, not UTF-16 character offsets.
Description
An HTML meta charset declaration must specify UTF-8 and fit entirely within the initial 1024 bytes.
An HTML meta charset declaration must specify UTF-8 and fit entirely within the initial 1024 bytes. Byte position in encoded source differs from character position in a JavaScript string.1
The tool returns utf8, withinFirst1024, passes. The fields describe the supplied local pattern or effective state, or contain the formatted markup shown below.
When to use Meta Charset First-1024-Bytes Check
Use this for the following task: Checks a supplied meta charset declaration and its exclusive ending byte offset against the first 1024 bytes rule. Byte positions must come from the original encoded HTML, not UTF-16 character offsets. Provide the requested local fields extracted from the relevant element or attribute.
How to use Meta Charset First-1024-Bytes Check and understand its results
- Prepare the parsed element names, attribute values or direct element-child lists requested below. Keep attribute presence separate from its value.
- Enter charset, tagEndByteExclusive according to the field table, then run the tool.
- Read utf8, withinFirst1024, passes. Check the effective state, recognized-token flags or generated markup against the rules below.
- Correct any reported local mismatch and check the resulting markup in its intended document and browser context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| charset | Charset | string; maximum text length 100 | Required |
| tagEndByteExclusive | Tag End Byte Exclusive | integer; minimum 0; maximum 9007199254740991 | Required |
Provide the parsed charset value and the exclusive ending byte offset of the declaration in the original encoded document. Return the two checks and their conjunction.
passes = charset equals utf-8 under ASCII case folding AND exclusive tag end≤1024 The symbols and boundary conditions refer to the supplied fields and the implementation described above.
| Output field | Meaning | Value type |
|---|---|---|
| utf8 | Utf8 | boolean |
| withinFirst1024 | Within First1024 | boolean |
| passes | Passes | boolean |
{
"input": {
"charset": "UTF-8",
"tagEndByteExclusive": 128
},
"output": {
"utf8": true,
"withinFirst1024": true,
"passes": true
}
} Limitations and assumptions
The tool trusts the supplied offset and does not read or encode a document. It does not trim the charset, assess duplicate declarations or resolve transport-header encoding.
The tool does not fetch a page, run a browser or validate an entire HTML document. Malformed tool requests produce input errors; valid requests can still report unrecognized values or failed local checks.
Alternative or Complementary methods
Choose Void Elements List Checker when you need its operation: Checks parsed HTML element names against the 13 current void elements; names are ASCII case insensitive. This does not parse markup or classify obsolete elements. Choose Meta Refresh seconds;url Format for the complementary operation: Builds an escaped meta refresh element from a nonnegative integer delay in seconds and an absolute HTTP(S) URL. The URL is normalized with the portable WHATWG URL helper; relative URLs and fractional-delay parser behavior are outside this builder profile.
Background reference: HTML Standard: Meta Charset First-1024-Bytes Check.
References
Similar or alternative tools
- Void Elements List Checker
Checks parsed HTML element names against the 13 current void elements; names are ASCII case insensitive. This does not parse markup or classify obsolete elements.
- Meta Refresh seconds;url Format
Builds an escaped meta refresh element from a nonnegative integer delay in seconds and an absolute HTTP(S) URL. The URL is normalized with the portable WHATWG URL helper; relative URLs and fractional-delay parser behavior are outside this builder profile.