How to check if a unicode character is full width?
I use Win32 / MFC
For example, 中
is full width, A
is not full width, F
is full width, F
is not full width.
What you need is to retrieve the East Asian Width of the character. You can do it by parsing the EastAsianWidth.txt file from the Unicode Character Database. I could not find a Win32 API that returns this info, but in Python, for example, you can use unicodedata.east_asian_width(unichr)
.
See the Annex #11 for the background of the problem and more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With