From f45de620b12c31525c2399a17f94b2ddf6a140b1 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 20 Aug 2017 20:41:19 -0600 Subject: [PATCH] Utilize explicit_encoding at export if set --- core/scanner_tossers/ftn_bso.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/scanner_tossers/ftn_bso.js b/core/scanner_tossers/ftn_bso.js index 8381789e..7c36a3df 100644 --- a/core/scanner_tossers/ftn_bso.js +++ b/core/scanner_tossers/ftn_bso.js @@ -390,11 +390,14 @@ function FTNMessageScanTossModule() { message.meta.FtnKludge.TID = ftnUtil.getProductIdentifier(); // - // Determine CHRS and actual internal encoding name - // Try to preserve anything already here + // Determine CHRS and actual internal encoding name. If the message has an + // explicit encoding set, use it. Otherwise, try to preserve any CHRS/encoding already set. // - let encoding = options.nodeConfig.encoding || 'utf8'; - if(message.meta.FtnKludge.CHRS) { + let encoding = options.nodeConfig.encoding || Config.scannerTossers.ftn_bso.packetMsgEncoding || 'utf8'; + const explicitEncoding = _.get(message.meta, 'System.explicit_encoding'); + if(explicitEncoding) { + encoding = explicitEncoding; + } else if(message.meta.FtnKludge.CHRS) { const encFromChars = ftnUtil.getEncodingFromCharacterSetIdentifier(message.meta.FtnKludge.CHRS); if(encFromChars) { encoding = encFromChars;