diff --git a/lib/buffer.js b/lib/buffer.js index f6f28294e3c3c7..3d5e96e52f3042 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -276,6 +276,7 @@ function byteLength(string, encoding) { case 'utf8': case 'utf-8': + case undefined: return binding.byteLengthUtf8(string); case 'ucs2':