I just noticed that a TMemo can't count a 4-bytes character as one character.
The TMemo can counts 1,2 or 3-bytes characters as one character but for a 4-bytes character it counts 2
For example, if Memo1.text:='A👽Ω♥B'; //total of 5 characters
A: 1-byte character====>count as one character
Ω: 2-bytes character===>count as one character
♥: 3-bytes character===>count as one character
👽: 4-bytes character==>count as two character
B: 1-byte character====>count as one character
Both of Memo1.CaretPos.X and Memo1.SelStart will return 6 instead of 5.
Do you know how to fix this issue in a TMemo? (This causes wrong insertion or deletion a character at CaretPos location within a text)
Lazarus 3.6
Windows 11 x64