Comparing version 4.2.0 to 4.2.1
# Changelog | ||
## v4.2.1 2019-10-28 | ||
- Replace jconv with more recent encoding-japanese | ||
## v4.2.0 2019-10-28 | ||
@@ -4,0 +8,0 @@ |
'use strict'; | ||
const iconv = require('iconv-lite'); | ||
const jconv = require('jconv'); | ||
const encodingJapanese = require('encoding-japanese'); | ||
const charsets = require('./charsets'); | ||
@@ -46,3 +46,18 @@ | ||
if (/^jis|^iso-?2022-?jp|^EUCJP/i.test(fromCharset)) { | ||
return jconv.decode(buf, fromCharset); | ||
if (typeof buf === 'string') { | ||
buf = Buffer.from(buf); | ||
} | ||
try { | ||
let output = encodingJapanese.convert(buf, { | ||
to: 'UNICODE', | ||
from: fromCharset, | ||
type: 'string' | ||
}); | ||
if (typeof output === 'string') { | ||
output = Buffer.from(output); | ||
} | ||
return output; | ||
} catch (err) { | ||
// ignore, defaults to iconv-lite on error | ||
} | ||
} | ||
@@ -49,0 +64,0 @@ |
{ | ||
"name": "libmime", | ||
"description": "Encode and decode quoted printable and base64 strings", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"main": "lib/libmime", | ||
@@ -22,4 +22,4 @@ "homepage": "https://github.com/andris9/libmime", | ||
"dependencies": { | ||
"encoding-japanese": "1.0.30", | ||
"iconv-lite": "0.5.0", | ||
"jconv": "^0.1.5", | ||
"libbase64": "1.2.1", | ||
@@ -36,5 +36,5 @@ "libqp": "1.1.0" | ||
"grunt-mocha-test": "0.13.3", | ||
"iconv": "^2.3.5", | ||
"iconv": "2.3.5", | ||
"mocha": "6.2.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145655
3193
+ Addedencoding-japanese@1.0.30
+ Addedencoding-japanese@1.0.30(transitive)
- Removedjconv@^0.1.5
- Removedjconv@0.1.5(transitive)