Skip to content

Commit 9ca8e32

Browse files
author
andris9
committed
do not use iconv if it's not found
1 parent 4e3893e commit 9ca8e32

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Diff for: mime-functions.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

2-
// see http://github.com/bnoordhuis/node-iconv for more info
3-
var Iconv = require("iconv").Iconv;
2+
try{
3+
// see http://github.com/bnoordhuis/node-iconv for more info
4+
var Iconv = require("iconv").Iconv;
5+
}catch(E){
6+
// convert nothing
7+
Iconv = function(){}
8+
Iconv.prototype.convert = function(buf){return buf;};
9+
}
410

511
/* mime related functions - encoding/decoding etc*/
612
/* TODO: Only UTF-8 and Latin1 are allowed with encodeQuotedPrintable */

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mimelib",
33
"description": "MIME functions to encode/decode e-mails etc.",
4-
"version": "0.1.1",
4+
"version": "0.1.2",
55
"author" : "Andris Reinman",
66
"homepage":"http://github.com/andris9/mimelib",
77
"maintainers":[

0 commit comments

Comments
 (0)