aboutsummaryrefslogtreecommitdiff
path: root/test/pseudo-tty/test-tty-stdout-end.js
diff options
context:
space:
mode:
authorJason Ginchereau <jasongin@microsoft.com>2017-04-18 15:02:00 -0700
committerMichael Dawson <michael_dawson@ca.ibm.com>2017-04-20 13:27:17 -0400
commit468275ac7911b3f7950f31e9799b6666c96f2c73 (patch)
treecd68719fd35229c81c2050baa51354aacc9fe3f7 /test/pseudo-tty/test-tty-stdout-end.js
parentce986de829457c39257cd205067602e765768fb0 (diff)
downloadandroid-node-v8-468275ac7911b3f7950f31e9799b6666c96f2c73.tar.gz
android-node-v8-468275ac7911b3f7950f31e9799b6666c96f2c73.tar.bz2
android-node-v8-468275ac7911b3f7950f31e9799b6666c96f2c73.zip
n-api: remove napi_get_value_string_length()
This API doesn't serve much purpose, and is only likely to cause confusion and bugs. The intention was that this would return the number of characters in a string independent of encoding, but that's not generally useful. In almost all cases, one of the encoding-specific napi_get_value_string_* APIs is more correct. (Pass a null buffer if only the encoded length is desired.) Anyway the current implementation of napi_get_value_string_length() is technically wrong: it returns the number of 2-byte code units of the UTF-16 encoding, but there are actually some characters that are encoded as two UTF-16 code units. Note the JavaScript String.prototype.length property returns the number of UTF-16 code units, which may be different from the number of characters. So, getting the true character count is not common with JavaScript, and is probably best left to specialized internationalization libraries. PR-URL: https://github.com/nodejs/node/pull/12496 Fixes: https://github.com/nodejs/abi-stable-node/issues/226 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/pseudo-tty/test-tty-stdout-end.js')
0 files changed, 0 insertions, 0 deletions