Test for a word boundary before UTF-16 index position using SFML's Unicode rules. The start and end are boundaries; the middle of a surrogate pair is not. Isolated surrogate code units are treated as U+FFFD.
text
position
position is not an integer from 0 to text.length.
Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0
Test for a word boundary before UTF-16 index position using SFML's Unicode rules. The start and end are boundaries; the middle of a surrogate pair is not. Isolated surrogate code units are treated as U+FFFD.