changing doc format and HTML literals
This commit is contained in:
@@ -7,18 +7,22 @@ str : string to be split
|
||||
compound_characters : optional, if true tries to combine compound characters
|
||||
return value : a list of Unicode characters
|
||||
|
||||
:desc
|
||||
Splits the string 'str' into its constituent Unicode code points.
|
||||
|
||||
If 'compound_characters' is true, split_utf8 will attempt to combine compound characters based on very simple rules:
|
||||
<li>combine characters if they're connected by a Zero-Width Joiner (ZWJ) character</li>
|
||||
<li>combine two characters if they're both a Regional Indicator Symbol Letter</li>
|
||||
<li>if a character is a Variation Selector, append it to the previous character</li>
|
||||
<li>in all other cases, characters remain on their own</li>
|
||||
|
||||
:see
|
||||
>string
|
||||
|
||||
:related
|
||||
**PHP:** `preg_split(//u, ...)`, `mb_*` helpers, or grapheme-aware libraries
|
||||
**JavaScript / Node.js:** `Array.from(str)` or iterator-based Unicode-aware splitting
|
||||
:content
|
||||
Splits `str` into its constituent Unicode code points.
|
||||
|
||||
If `compound_characters` is `true`, `split_utf8()` also applies a small amount of grouping so some multi-code-point glyphs stay together. The current rules are:
|
||||
|
||||
- combine characters joined by a Zero-Width Joiner (ZWJ)
|
||||
- combine two Regional Indicator Symbol Letter characters
|
||||
- append Variation Selectors to the previous character
|
||||
- otherwise leave characters as separate entries
|
||||
|
||||
This is useful when simple byte-wise or ASCII splitting would break Unicode text incorrectly.
|
||||
|
||||
Related:
|
||||
|
||||
- PHP: `preg_split(//u, ...)`, `mb_*` helpers, or grapheme-aware libraries
|
||||
- JavaScript / Node.js: `Array.from(str)` or iterator-based Unicode-aware splitting
|
||||
|
||||
Reference in New Issue
Block a user