Doesn't support Chinese characters in the textfield
underthestars-zhy opened this issue · comments
The Chinese characters will become strange symbols
Thank you for reporting 👍
Not just Chinese characters, any multibyte character seem to fall apart.
For example, here's "Árvíztűrő tükörfúrógép" as it appears in the ToDoList sample: Ã�rvÃztűrÅ� tükörfúrógé
This has some serious MS-DOS vibes 😄 But instead of codepage mismatches, this one is caused by reading one byte at a time from the standard input. Perhaps there's a more robust solution in Darwin?
Thanks @vzsg for coming up with a fix for the character encoding 👏
With Chinese characters and emojis however, there is a second issue, which is that they are considered double-width by many Terminal apps. That means they occupy twice the width of other characters, and the cursor is moved two positions as well, which the rendering code in SwiftTUI doesn't handle properly. We might have to consider support for double-width characters as a new feature, unrelated to this encoding bug.