New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
std/text/unicode width does not return column-width 2 for emojis #457
Comments
This is what the standard library documentation says:
So yes, I believe the intent is for terminal emulators as in the python wcwidth spec, however I'm not certain if it is currently up to date (I'm not sure when Daan last updated the asian-wide list). Also I would expect the following to print two utf16 characters, but it only does one utf32 character. I guess I'm less certain on the intended underlying representation for characters. I'll have to ask Daan. |
I'll just link this article here. It's a good read with some valuable links https://mitchellh.com/writing/grapheme-clusters-in-terminals |
Thanks for the link! |
Great post. I'll have to look at the algorithm he references to improve Koka's clustering |
Yeah i'm a beta tester on the Ghostty terminal (it's great!), and they have implemented Mode 2027 for proper Unicode handling |
I did expect the
width
function to return 2 for emojis when using the EastAsianWidth.txt file.this returns 1
Is this method supposed to work similar to the display_width method of
ziglyph
or similar to this Python wcwidth spesification ? That is to give the rendered column width for modern terminal emulators using the latest Unicode standard?The text was updated successfully, but these errors were encountered: