Merge branch 'master' of ssh://numinibsd/git/base/enigma-bbs

This commit is contained in:
Bryan Ashby 2016-04-10 22:04:06 -06:00
commit 0c1d0d75bd
1 changed files with 8 additions and 1 deletions

View File

@ -469,7 +469,14 @@ function Packet(options) {
// Decode |messageBodyBuffer| using |encoding| defaulted or detected above // Decode |messageBodyBuffer| using |encoding| defaulted or detected above
// //
// :TODO: Look into \xec thing more - document // :TODO: Look into \xec thing more - document
const messageLines = iconv.decode(messageBodyBuffer, encoding).replace(/\xec/g, '').split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g); let decoded;
try {
decoded = iconv.decode(messageBodyBuffer, encoding);
} catch(e) {
decoded = iconv.decode(messageBodyBuffer, 'ascii');
}
//const messageLines = iconv.decode(messageBodyBuffer, encoding).replace(/\xec/g, '').split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g);
const messageLines = decoded.replace(/\xec/g, '').split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g);
let endOfMessage = true; let endOfMessage = true;
messageLines.forEach(line => { messageLines.forEach(line => {