go-runewidth

Provides functions to get fixed width of the character or string.

Usage

runewidth.StringWidth("つのだ☆HIRO") == 12

NOTE: Latin letters that Unicode gives ambiguous East Asian width, such as ü, é and ß, are measured as one cell even when EastAsianWidth is set, as terminals draw them in CJK locales too. Other ambiguous characters such as ±, × and ○ still take two cells there.

Author

Yasuhiro Matsumoto

License

under the MIT License: http://mattn.mit-license.org/2013