mailparser
Advanced tools
Comparing version 0.2.7 to 0.2.8
@@ -35,2 +35,3 @@ | ||
* <li><b>unescapeSMTP</b> - if set to true replace double dots in the beginning of the file</li> | ||
* <li><b>defaultCharset</b> - the default charset for text/plain, text/html content, if not set reverts to Latin-1 | ||
* </ul> | ||
@@ -271,3 +272,3 @@ * | ||
if(this._currentNode.meta.charset){ | ||
attachment.charset = this._currentNode.meta.charset || "utf-8"; | ||
attachment.charset = this._currentNode.meta.charset; | ||
} | ||
@@ -533,3 +534,5 @@ | ||
}else if(value.charset.match(/^utf\d/)){ | ||
value.charset = "utf-"+value.charset.substr(3); | ||
value.charset = "utf-"+value.charset.substr(3); | ||
}else if(value.charset.match(/^latin[\-_]?\d/)){ | ||
value.charset = "iso-8859-"+value.charset.replace(/\D/g,""); | ||
}else if(value.charset.match(/^(us\-)?ascii$/)){ | ||
@@ -682,5 +685,5 @@ value.charset = "utf-8"; | ||
if(this._currentNode.meta.transferEncoding == "quoted-printable"){ | ||
this._currentNode.content = mimelib.decodeQuotedPrintable(this._currentNode.content, false, this._currentNode.meta.charset); | ||
this._currentNode.content = mimelib.decodeQuotedPrintable(this._currentNode.content, false, this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1"); | ||
}else if(this._currentNode.meta.transferEncoding == "base64"){ | ||
this._currentNode.content = mimelib.decodeBase64(this._currentNode.content, false, this._currentNode.meta.charset); | ||
this._currentNode.content = mimelib.decodeBase64(this._currentNode.content, false, this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1"); | ||
} | ||
@@ -889,3 +892,3 @@ }else{ | ||
MailParser.prototype._encodeString = function(value){ | ||
value = this._replaceMimeWords(this._convertString(value, this._currentNode.meta.charset).toString("utf-8")); | ||
value = this._replaceMimeWords(this._convertString(value, this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1").toString("utf-8")); | ||
return value; | ||
@@ -892,0 +895,0 @@ }; |
{ | ||
"name": "mailparser", | ||
"description": "Asynchronous and non-blocking parser for mime encoded e-mail messages", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"author" : "Andris Reinman", | ||
@@ -6,0 +6,0 @@ "maintainers":[ |
@@ -50,2 +50,3 @@ | ||
* **unescapeSMTP** - if set to true replace double dots in the beginning of the file | ||
* **defaultCharset** - the default charset for *text/plain*, *text/html content*, if not set reverts to Latin-1 | ||
@@ -52,0 +53,0 @@ MailParser object is a writable Stream - you can pipe directly |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2831754
2270
184