[Issue 17810] Add wcwidth/wcswidth equivalents to std.uni

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 13 13:59:40 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=17810

--- Comment #4 from hsteoh at quickfur.ath.cx ---
We don't need to rely on the local OS implementation of this function; std.uni
has enough tools to provide a native implementation. Also, this is independent
of Posix, even though wcwidth/wcswidth are the names under which the Posix
standard provides this functionality; Unicode TR11 specifies an East Asian
Width property for characters. The data file can be obtained here:

ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt

Here's a tentative implementation that I made using std.uni's Trie facilities:

https://github.com/quickfur/strwidth

I hope to get this into shape to add to std.uni at some point.

--


More information about the Digitalmars-d-bugs mailing list