Skip to content

Main content

Content Type Charset Single Parameter Tool

Format a single unquoted HTTP charset parameter from an ASCII token, lowercasing its case-insensitive name.

Loading tool…

Description

Require charset to be a nonempty HTTP token, lowercase it, and prepend charset= for parameter.

HTTP response headers and content-security tokens carry separate pieces of a browser policy. Recognizing one directive or formatting one token does not establish that the complete policy is valid or effective.

Require charset to be a nonempty HTTP token, lowercase it, and prepend charset= for parameter.

When to use this tool

Use Content Type Charset Single Parameter when you need a narrowly scoped header component check or formatter before assembling and testing a complete response policy.

How to use the tool and how it works

  1. Enter charset. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read parameter. Use the output convention below.

Require charset to be a nonempty HTTP token, lowercase it, and prepend charset= for parameter.1

Input fieldMeaning and unitsAccepted input
charsetCharsetRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
parameterParameterRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "charset": "UTF-8"
  },
  "output": {
    "parameter": "charset=utf-8"
  }
}

Limitations and assumptions

  • This formats one parameter without selecting a registered encoding or parsing a complete Content-Type header.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Parse the complete header and test its behavior in the intended browser when policy effectiveness matters.

References

  1. Calculation and input contract: web/content-type-charset-single-parameter — tool.io

Similar or alternative tools