Utilize explicit_encoding at export if set

This commit is contained in:
Bryan Ashby 2017-08-20 20:41:19 -06:00
parent bf8552e24f
commit f45de620b1
1 changed files with 7 additions and 4 deletions

View File

@ -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;