platform independent, header only, wcwidth with full unicode 9 support
This code is primarily derived from the neovim project. The tables were produced from parsing the official unicode files EastAsianWidth.txt and emoji-data.txt using genunicodetables.lua.
Simply include wcwidth9.h
in your project and use the wcwidth9
function. It works just like wcwidth
.
The input value c
is expected to be a unicode code point value. The widths returned are according to unicode version 9.0.0.
Return values:
1
or 2
: the width of the character-1
: non-printable, combining or unassigned character-2
: ambiguous width character-3
: private-use characterAmbiguous width characters should almost always be considered width 1
except in the context of some East Asian languages as described here.
As private-use characters may not necessarily need to vary depending on East Asian context, but are still considered ambiguous, a separate return value is provided to distinguish them.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4