Update wcwidth implementation.

This commit is contained in:
Qi Xiao 2016-10-08 01:28:42 +08:00
parent 1e0bc746b8
commit b240fb39f1

View File

@ -84,9 +84,11 @@ func Wcwidth(r rune) int {
(r >= 0xfe10 && r <= 0xfe19) || /* Vertical forms */
(r >= 0xfe30 && r <= 0xfe6f) || /* CJK Compatibility Forms */
(r >= 0xff00 && r <= 0xff60) || /* Fullwidth Forms */
(r >= 0xffe0 && r <= 0xffe6) ||
(r >= 0x20000 && r <= 0x2fffd) ||
(r >= 0x30000 && r <= 0x3fffd)) {
(r >= 0xffe0 && r <= 0xffe6) || /* Fullwidth Forms */
(r >= 0x20000 && r <= 0x2fffd) || /* CJK Extensions */
(r >= 0x30000 && r <= 0x3fffd) || /* Reserved for historical Chinese scripts */
(r >= 0x25a0 && r <= 0x27bf) || // Geometric Shapes, Miscellaneous Symbols, Dingbats
(r >= 0x1f300 && r <= 0x1f6ff)) { // Miscellaneous Symbols and Pictographs ... Geometric Shapes Extended
return 2
}
return 1