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