Post

Replies

Boosts

Views

Activity

Comment on Unexpected Insertion of U+2004 (Space) When Using UITextView with Pinyin Input on iOS 18
The issue arises because I calculate the position of mentions by predicting the number of characters added. When recalculating the mention positions, I rely on the shouldChangeTextIn range and replacementText to estimate the changes. However, the replacementText only gives me the character “ㄨ”, which leads me to believe that only one character is being added. In reality, it also includes an invisible U+2004, causing the calculation to fail due to an incorrect prediction.
2d