Description
Normalize each string to NFD and count Unicode marks.
A visible character can contain multiple Unicode code points, and equivalent letters may have composed or decomposed representations. Mark counts differ from grapheme counts or linguistic correctness.
Normalize each string to NFD and count Unicode marks.
When to use this tool
Use Transliteration Diacritic Preservation Count when you need a narrowly defined Unicode mark or delimiter check.
How to use the tool and how it works
- Enter source, rendered. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read sourceMarks, renderedMarks, netRemoved. Use the output convention below.
Normalize each string to NFD and count Unicode marks. Return sourceMarks, renderedMarks, and their signed difference.1
NFD uses canonical decomposition. Counting marks after decomposition makes a precomposed accented letter comparable in this count with its decomposed representation, without proving that the same marks occur in both strings.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| source | Source identifier or source selector, interpreted under the calculation above. | Required. Text; maximum UTF-16 length 8192. |
| rendered | Rendered | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| sourceMarks | Source Marks | Required. Safe integer. |
| renderedMarks | Rendered Marks | Required. Safe integer. |
| netRemoved | Net Removed | Required. Safe integer. |
{
"input": {
"source": "éā",
"rendered": "ea"
},
"output": {
"sourceMarks": 2,
"renderedMarks": 0,
"netRemoved": 2
}
} Limitations and assumptions
- Equal counts do not prove the same diacritics were preserved; code-point comparison, transliteration quality, and grapheme equivalence are not assessed.
- 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
Use Unicode normalization and grapheme-aware comparison where visual equivalence or text editing behavior matters.
References
Similar or alternative tools
- Arabic Digit Delimiter Kind
Classify U+066B, U+066C, ASCII period, and ASCII comma with fixed tokens; return other for remaining characters.
- Public Transliteration Emphatic Token
Return exact membership of token in suppliedEmphaticTokens.