Skip to content

Main content

Unicode Combining Class Source Value

Qualify one explicit character and caller-supplied canonical combining class by Unicode version without performing a Unicode database lookup.

Loading tool…

Description

Record a supplied Unicode combining class and version for one code point.

Unicode text has several distinct length and position bases: UTF-16 code units, code points, grapheme clusters and rendered glyphs. An edit offset in source text need not equal an offset in decoded text. Unicode properties also belong to a specific version; recording a property value is distinct from looking it up or validating it.

Record a supplied Unicode combining class and version for one code point.

When to use this tool

Use Unicode Combining Class Source Value when you already have character, suppliedCombiningClass, unicodeVersion and need to record a supplied Unicode combining class and version for one code point.

How to use the tool and how it works

  1. Enter character, suppliedCombiningClass, unicodeVersion. 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 sourceQualifiedToken. Use the output convention below.

Require Array.from(character).length=1, safe whole class in [0,255] and nonempty unicodeVersion; encode [character,class,version] as JSON text.1

Canonical combining class is a versioned Unicode property used in canonical ordering. Recording a supplied class does not query the database or normalize text.2

Input fieldMeaning and unitsAccepted input
characterExactly one Array.from element; may be one surrogate code unit and is not checked as a Unicode scalar.Required. Text; maximum UTF-16 length 8192.
suppliedCombiningClassCaller-supplied whole canonical combining class 0..255; no property lookup.Required. Safe integer; minimum 0; maximum 255.
unicodeVersionUnicode VersionRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
sourceQualifiedTokenSource Qualified TokenRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "character": "é",
    "suppliedCombiningClass": 0,
    "unicodeVersion": "16.0"
  },
  "output": {
    "sourceQualifiedToken": "[\"é\",0,\"16.0\"]"
  }
}

Limitations and assumptions

  • No Unicode database is queried; a lone surrogate is not excluded by this code-point-count test, and the supplied combining class is not verified.
  • 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

Use a Unicode property database for the stated version when an actual property lookup is needed. For source edits, map offsets in the original text and keep UTF-16 positions separate from decoded code points, grapheme boundaries and display widths.

References

  1. Calculation and input contract: text/unicode-combining-class-source-value — tool.io

  2. Unicode Character Database: canonical combining class — Unicode Consortium

Similar or alternative tools