new module (iconv-lite) to attempt char encodings
This commit is contained in:
@@ -256,7 +256,10 @@ ${html_entities.encode(message.to_addr)} ${(html_entities.encode(message.to_name
|
|||||||
<tr>
|
<tr>
|
||||||
<td nowrap valign=top>
|
<td nowrap valign=top>
|
||||||
Subject: <td>
|
Subject: <td>
|
||||||
<td>
|
<td>`;
|
||||||
|
|
||||||
|
if (typeof message.subject == "object") message.subject = new Buffer.from(message.subject).toString('latin1');
|
||||||
|
data += `
|
||||||
${html_entities.encode((message.subject) ? message.subject : '(No subject)')}
|
${html_entities.encode((message.subject) ? message.subject : '(No subject)')}
|
||||||
<tr>
|
<tr>
|
||||||
<td height=10>
|
<td height=10>
|
||||||
@@ -289,7 +292,9 @@ ${html_entities.encode((message.subject) ? message.subject : '(No subject)')}
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (typeof message.body == "object") message.body = new Buffer.from(message.body).toString('latin1');
|
if (typeof message.body == "object") {
|
||||||
|
message.body = iconv.decode(Buffer.from(message.body), 'ISO-8859-1');
|
||||||
|
}
|
||||||
data += `
|
data += `
|
||||||
${html_entities.encode(message.body).replace(/\n/gi, "<br>").replace(/\r/gi, "").replace(/'/gi, "'")}
|
${html_entities.encode(message.body).replace(/\n/gi, "<br>").replace(/\r/gi, "").replace(/'/gi, "'")}
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const WTVLzpf = require('./WTVLzpf.js');
|
|||||||
const WTVClientCapabilities = require('./WTVClientCapabilities.js');
|
const WTVClientCapabilities = require('./WTVClientCapabilities.js');
|
||||||
const WTVClientSessionData = require('./WTVClientSessionData.js');
|
const WTVClientSessionData = require('./WTVClientSessionData.js');
|
||||||
const WTVMime = require("./WTVMime.js");
|
const WTVMime = require("./WTVMime.js");
|
||||||
|
const iconv = require('iconv-lite');
|
||||||
const { WTVShared, clientShowAlert } = require("./WTVShared.js");
|
const { WTVShared, clientShowAlert } = require("./WTVShared.js");
|
||||||
|
|
||||||
process
|
process
|
||||||
|
|||||||
38
zefie_wtvp_minisrv/package-lock.json
generated
38
zefie_wtvp_minisrv/package-lock.json
generated
@@ -13,6 +13,7 @@
|
|||||||
"easy-crc": "0.0.2",
|
"easy-crc": "0.0.2",
|
||||||
"endianness": "^8.0.2",
|
"endianness": "^8.0.2",
|
||||||
"html-entities": "^2.3.2",
|
"html-entities": "^2.3.2",
|
||||||
|
"iconv-lite": "^0.6.3",
|
||||||
"mime-types": "^2.1.33",
|
"mime-types": "^2.1.33",
|
||||||
"proxy-agent": "^5.0.0",
|
"proxy-agent": "^5.0.0",
|
||||||
"socks-proxy-agent": "^6.1.1",
|
"socks-proxy-agent": "^6.1.1",
|
||||||
@@ -290,11 +291,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/iconv-lite": {
|
"node_modules/iconv-lite": {
|
||||||
"version": "0.4.24",
|
"version": "0.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"safer-buffer": ">= 2.1.2 < 3"
|
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
@@ -494,6 +495,17 @@
|
|||||||
"node": ">= 0.8"
|
"node": ">= 0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/raw-body/node_modules/iconv-lite": {
|
||||||
|
"version": "0.4.24",
|
||||||
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||||
|
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||||
|
"dependencies": {
|
||||||
|
"safer-buffer": ">= 2.1.2 < 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/readable-stream": {
|
"node_modules/readable-stream": {
|
||||||
"version": "1.1.14",
|
"version": "1.1.14",
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
|
||||||
@@ -853,11 +865,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"iconv-lite": {
|
"iconv-lite": {
|
||||||
"version": "0.4.24",
|
"version": "0.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"safer-buffer": ">= 2.1.2 < 3"
|
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"inherits": {
|
"inherits": {
|
||||||
@@ -1020,6 +1032,16 @@
|
|||||||
"http-errors": "1.7.3",
|
"http-errors": "1.7.3",
|
||||||
"iconv-lite": "0.4.24",
|
"iconv-lite": "0.4.24",
|
||||||
"unpipe": "1.0.0"
|
"unpipe": "1.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"iconv-lite": {
|
||||||
|
"version": "0.4.24",
|
||||||
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||||
|
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||||
|
"requires": {
|
||||||
|
"safer-buffer": ">= 2.1.2 < 3"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"readable-stream": {
|
"readable-stream": {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
"easy-crc": "0.0.2",
|
"easy-crc": "0.0.2",
|
||||||
"endianness": "^8.0.2",
|
"endianness": "^8.0.2",
|
||||||
"html-entities": "^2.3.2",
|
"html-entities": "^2.3.2",
|
||||||
|
"iconv-lite": "^0.6.3",
|
||||||
"mime-types": "^2.1.33",
|
"mime-types": "^2.1.33",
|
||||||
"proxy-agent": "^5.0.0",
|
"proxy-agent": "^5.0.0",
|
||||||
"socks-proxy-agent": "^6.1.1",
|
"socks-proxy-agent": "^6.1.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user