From 046f1ba1e83fef83f96cf5db55071698a73386ed Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Tue, 21 May 2024 19:27:11 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20an=20un-normalized=20encoding=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …saving the C++ code from receiving a Node-style encoding name that it doesn’t recognize. --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index f28fa189..76d66c50 100644 --- a/index.js +++ b/index.js @@ -283,6 +283,8 @@ if (process.env.SUPERSTRING_USE_BROWSER_VERSION) { } TextBuffer.prototype.baseTextMatchesFile = function (source, encoding = 'UTF8') { + encoding = normalizeEncoding(encoding) + return new Promise((resolve, reject) => { const callback = (error, result) => { if (error) {