src: network interface names are UTF-8 encoded
authorBen Noordhuis <info@bnoordhuis.nl>
Mon, 3 Nov 2014 15:42:07 +0000 (16:42 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Wed, 5 Nov 2014 19:39:24 +0000 (20:39 +0100)
commite13663d647d036d49872b7ab99a5fb7b9d9268df
tree063b9405d368defe79dca3ed4f79bd1661a46f49
parent7ab73ff735b26207c99b4259c4fd7c1aa8c23643
src: network interface names are UTF-8 encoded

Fixes a bug that was introduced in commit f674b09 when v8::String::New()
calls were replaced with calls to one-byte, two-byte and UTF-8 versions.
It turns out that for network interface names, using a one-byte encoding
can produce the wrong results on Windows.  Use UTF-8 instead.

Libuv on Windows correctly encodes non-ASCII characters in the interface
name as UTF-8.  On Unices however, the interface name is just a binary
string with no particular encoding; that's why on UNIX platforms, we
keep interpreting it as a one-byte string.

Fixes joyent/node#8633.

PR-URL: https://github.com/node-forward/node/pull/44
Reviewed-By: Bert Belder <bertbelder@gmail.com>
src/node_os.cc