characters icon indicating copy to clipboard operation
characters copied to clipboard

Zero-Width Non-Joiner (\u200c) character does not count

Open pourqavam opened this issue 3 years ago • 0 comments

Hi Some languages like Persian uses \u200c (Zero-Width Non-Joiner) as half space (Shift + Space), but this package does not count this character. It makes problem in max length of the Flutter text field (native Android counts it properly).

// Zero-Width Non-Joiner (invisible character)
print(Characters('س\u200cس').length); // Prints 2 (Incorrect)

// Left-to-Right Mark (invisible character)
print(Characters('س\u200eس').length); // Prints 3 (Correct)

https://en.wikipedia.org/wiki/Zero-width_non-joiner

pourqavam avatar Dec 04 '21 13:12 pourqavam