Description
Replace U+2028 and U+2029 with their literal backslash-u escape spellings and return separate line- and paragraph-separator counts.
Text positions can be measured in UTF-16 code units, Unicode code points, grapheme clusters, or modeled display columns. These coordinates are not interchangeable. Invisible markers and delimiter policies can also affect interpretation even when a string looks unchanged, so the chosen representation needs to stay explicit.
Replace U+2028 and U+2029 with their literal backslash-u escape spellings and return separate line- and paragraph-separator counts.
When to use this tool
Use Unicode Line Separator Escape Label when you need the stated marker, coordinate, delimiter, or normalization operation under an explicit text representation.
How to use the tool and how it works
- Enter text. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read escaped, lineSeparators, paragraphSeparators. Use the output convention below.
Replace U+2028 and U+2029 with their literal backslash-u escape spellings and return separate line- and paragraph-separator counts.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| text | Text | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| escaped | Text with only U+2028 and U+2029 replaced by visible escape spellings. | Required. Text; maximum UTF-16 length 8192. |
| lineSeparators | Line Separators | Required. Safe integer. |
| paragraphSeparators | Paragraph Separators | Required. Safe integer. |
{
"input": {
"text": "a
b
c"
},
"output": {
"escaped": "a\\u2028b\\u2029c",
"lineSeparators": 1,
"paragraphSeparators": 1
}
} Limitations and assumptions
- Other characters, quotes, and backslashes are unchanged. This makes two separators visible but does not produce a fully escaped JSON or JavaScript string literal.
- The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
Alternative or Complementary methods
Choose the coordinate system required by the consumer. Use a full parser, renderer, or segmentation method when a local marker or delimiter rule cannot determine the complete text behavior.
References
Similar or alternative tools
- Text: Bidi Control Visible Name Label
Name one of the twelve Unicode Bidi_Control code points for visible inspection, without applying the bidirectional layout algorithm.
- Line Break CRLF Byte Budget
Count CRLF pairs and remaining lone LF characters, returning bytesAdded equal to lone LF count under a conversion to CRLF.