summaryrefslogtreecommitdiff
path: root/lib/crypto.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/crypto.js')
-rw-r--r--lib/crypto.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/crypto.js b/lib/crypto.js
index 4650067fe..0cc70ff15 100644
--- a/lib/crypto.js
+++ b/lib/crypto.js
@@ -236,6 +236,7 @@ Hmac.prototype._transform = Hash.prototype._transform;
function getDecoder(decoder, encoding) {
+ if (encoding === 'utf-8') encoding = 'utf8'; // Normalize encoding.
decoder = decoder || new StringDecoder(encoding);
assert(decoder.encoding === encoding, 'Cannot change encoding');
return decoder;