Description
Count label as UTF-8 bytes when useUtf8Bytes, otherwise Unicode code points, and return used, remaining, and a strict exceeds flag.
A specimen label is both text and an encoded record. Unicode code points and UTF-8 bytes measure different lengths, while neither directly measures printed width or whether a label can be read reliably.
Count label as UTF-8 bytes when useUtf8Bytes, otherwise Unicode code points, and return used, remaining, and a strict exceeds flag.
When to use this tool
Use Specimen Label Character Budget when you need to compare supplied specimen-label text with an explicit storage budget.
How to use the tool and how it works
- Enter label, suppliedLimit, useUtf8Bytes. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read used, remaining, exceeds. Inspect exceeds before interpreting the associated values.
Require nonnegative integer suppliedLimit. Count label as UTF-8 bytes when useUtf8Bytes, otherwise Unicode code points, and return used, remaining, and a strict exceeds flag.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| label | Label | Required. Text; maximum UTF-16 length 8192. |
| suppliedLimit | Supplied Limit | Required. Safe integer; minimum 0. |
| useUtf8Bytes | True counts UTF-8 bytes; false counts Unicode code points. | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| used | Encoding length, not rendered label width or grapheme count. | Required. Safe integer. |
| remaining | Remaining | Required. Safe integer. |
| exceeds | Exceeds | Required. Boolean. |
{
"input": {
"label": "Aé",
"suppliedLimit": 3,
"useUtf8Bytes": true
},
"output": {
"used": 3,
"remaining": 0,
"exceeds": false
}
} Limitations and assumptions
- Neither count is grapheme count, printed width, or label capacity; encoding behavior and the limit are explicit, without validating specimen identity or a regulatory labeling rule.
- 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
Measure rendered labels and validate them against the actual printer, database, and identification workflow. Use the destination's encoding and field constraints for storage compatibility.
References
Similar or alternative tools
- GLP Report Section Page Reference
Return citedPages outside it in input order, the inclusive span, and a JSON-array section/range key.
- GLP Study Sample Aliquot Parent Pair
Compare declaredParent with expectedParent and studyId with expectedStudy literally.