Description
Count headline by Unicode code points.
Text layout distinguishes Unicode characters, encoded bytes, and visual columns. These counts need not agree: a tab depends on its column position, while a newline is a sequence of characters with a particular spelling.
Count headline by Unicode code points.
When to use this tool
Use Headline Character Budget when you need one deterministic text-layout or encoding component under the stated counting convention.
How to use the tool and how it works
- Enter headline, maximumCodePoints. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read usedCodePoints, remainingCodePoints, withinBudget. Inspect withinBudget before interpreting the associated values.
Count headline by Unicode code points. Subtract usedCodePoints from nonnegative maximumCodePoints and compare inclusively for withinBudget.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| headline | Headline | Required. Text; maximum UTF-16 length 8192. |
| maximumCodePoints | Maximum Code Points | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| usedCodePoints | Used Code Points | Required. Safe integer. |
| remainingCodePoints | Remaining Code Points | Required. Safe integer. |
| withinBudget | Within Budget | Required. Boolean. |
{
"input": {
"headline": "News today",
"maximumCodePoints": 20
},
"output": {
"usedCodePoints": 10,
"remainingCodePoints": 10,
"withinBudget": true
}
} Limitations and assumptions
- Negative remaining budgets are retained; code points differ from graphemes, UTF-16 units, byte length, and visual headline width.
- 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.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Inspect the final text in the target encoding and renderer when display width or line wrapping matters.
References
Similar or alternative tools
- UTF-8 Codepoint Byte Budget
Validate codePoint as a Unicode scalar and return one, two, three, or four UTF-8 bytes at the 0x7F, 0x7FF, and 0xFFFF boundaries.
- Caption Character Rate Cue
Require nonnegative integer characterCount and positive durationSeconds and divide for charactersPerSecond.