From e1bb91c5376c81ae2bc9ab54b7cb3fcebef14d63 Mon Sep 17 00:00:00 2001 From: "Leon M. Busch-George" Date: Thu, 17 Aug 2023 07:46:31 +0200 Subject: [PATCH] lazy-load encodings using a more reliable path --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 657701c..0d76c87 100644 --- a/lib/index.js +++ b/lib/index.js @@ -60,7 +60,7 @@ iconv.fromEncoding = iconv.decode; iconv._codecDataCache = {}; iconv.getCodec = function getCodec(encoding) { if (!iconv.encodings) - iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. + iconv.encodings = require(__dirname + "/../encodings"); // Lazy load all encoding definitions. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. var enc = iconv._canonicalizeEncoding(encoding);