1- wcwidth: a javascript porting of C's wcwidth()
2- ==============================================
1+ wcwidth.js : a javascript porting of C's wcwidth()
2+ =================================================
33
4- ` wcwidth ` is a simple JavaScript porting of ` wcwidth() ` implemented in C
4+ ` wcwidth.js ` is a simple javascript porting of ` wcwidth() ` implemented in C
55[ by Markus Kuhn] ( http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c ) .
66
77[ ` wcwidth() ` ] ( http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html )
@@ -13,8 +13,8 @@ devices like terminals. Markus's implementation assumes wide characters to be
1313encoded in [ ISO 10646] ( http://en.wikipedia.org/wiki/Universal_Character_Set ) ,
1414which is _ almost_ true for JavaScript; _ almost_ because JavaScript uses
1515[ UCS-2] ( http://en.wikipedia.org/wiki/UTF-16 ) and has problems with surrogate
16- pairs. ` wcwidth ` converts surrogate pairs to Unicode code points to handle them
17- correctly.
16+ pairs. ` wcwidth.js ` converts surrogate pairs to Unicode code points to handle
17+ them correctly.
1818
1919Following the original implementation, this library defines the column width of
2020an ISO 10646 character as follows:
@@ -45,12 +45,12 @@ A surrogate high or low value which constitutes no pair is considered to have a
4545column width of 1 according to the behavior of widespread terminals.
4646
4747See the
48- [ documentation] ( https://github.com/mycoboco/wcwidth/blob/master/doc/index.md )
48+ [ documentation] ( https://github.com/mycoboco/wcwidth.js /blob/master/doc/index.md )
4949from the C implementation for details.
5050
51- ` wcwidth ` is simple to use:
51+ ` wcwidth.js ` is simple to use:
5252
53- var wcwidth = require('wcwidth')
53+ var wcwidth = require('wcwidth.js ')
5454
5555 wcwidth('한글') // 4
5656 wcwidth('\0') // 0; NUL
@@ -81,8 +81,8 @@ containing an instance of `NUL` or control characters:
8181
8282This is useful when detecting if a string has non-printable characters.
8383
84- Due to the risk of monkey-patching, ` wcwidth ` no longer provides the ` String `
85- getter. Even if discouraged, you can still monkey-patch by yourself as follows:
84+ Due to the risk of monkey-patching, the ` String ` getter is no longer provided.
85+ Even if discouraged, you can still monkey-patch by yourself as follows:
8686
8787 String.prototype.__defineGetter__('wcwidth', function () {
8888 return wcwidth(this);
0 commit comments