Open ashtuchkin opened 10 years ago
Today I ran into this when trying to parse my gmail .mbox
(https://support.google.com/accounts/answer/3024195?hl=en) with the https://www.npmjs.org/package/mbox-stream module which uses https://www.npmjs.org/package/mailparser which uses iconv-lite
[Error: Encoding not recognized: 'ISO-2022-JP' (searched as: 'iso2022jp')]
Ah actually I forgot to also mention that mailparser uses https://www.npmjs.org/package/encoding which in turn uses iconv-lite
, but encoding
is supposed to be normalization layer around iconv
and iconv-lite
so it shouldn't have crashed here. Seems like a bug in encoding
, i'll file an issue there as well
AFAIK, you just need to install node-iconv yourself for encoding module to use it. Let me know if it helped.
ISO-2022-JP is a rare encoding nowadays and is quite different in structure than most others (its stateful), so to support it I'd need to write separate codec. I didn't want to make these efforts until at least a couple of people said they need it. Your vote is the first for now) On Nov 7, 2014 5:05 AM, "Max Ogden" notifications@github.com wrote:
Ah actually I forgot to also mention that mailparser uses https://www.npmjs.org/package/encoding which in turn uses iconv-lite, but encoding is supposed to be normalization layer around iconv and iconv-lite so it shouldn't have crashed here. Seems like a bug in encoding, i'll file an issue there as well
— Reply to this email directly or view it on GitHub https://github.com/ashtuchkin/iconv-lite/issues/60#issuecomment-62139268 .
I'll throw my vote in here. Just ran into the same error.
Got it! Thanks
Alexander Shtuchkin
On Mon, Dec 1, 2014 at 8:24 AM, coyle notifications@github.com wrote:
I'll throw my vote in here. Just ran into the same error.
— Reply to this email directly or view it on GitHub https://github.com/ashtuchkin/iconv-lite/issues/60#issuecomment-65090106 .
Would love to get it supported as well :+1:
Casting my vote in support as well, our node-fetch uses encoding which uses iconv-lite
by default, I found out about this on production server today, installing iconv
certainly helps resolving this issue :)
Just adding my vote for this issue as well. This appears to be an encoding that's used widely enough in email that it has become a would-be really-really-really-nice-to-have for my application.
I will look into what writing a new codec for this encoding involves and if possible will write one myself and submit a pull request.
EDIT: Scratch that, it looks like node-iconv already supports this so I'll go with that for now.
vote for this.
I also vote for this, it would be great to have since i run into this problem every time i deal with japanese emails.
You get my vote. Just ran into this issue.
Also my vote for this, just ran into same situation.
=> need to use both iconv-lite
& iconv
at the same time which I don't like! 💀
Another vote! Also dealing with emails.
As of now, in AWS Lambda, using the packages depend on native module such as node-iconv is quite a bit hard or tricky, so I wanna use iconv-lite rather than it if I can.
As MailParser (https://github.com/nodemailer/mailparser) depends on this module, Japanese mails sent from outlook cannot be converted correctly with it. Supporting ISO-2022-JP is very important for Japanese user!
My vote for this.
I also want iso-2022-jp support on iconv-lite.
As mentioned by another reporter, MailParser depends on iconv-lite for decoding message body.
And also libmime depends on iconv-lite for decoding 'encoded-word' (defined at RFC 2047) like:
=?iso-2022-jp?B?GyRCNElNfSQ3JD8lOyUtJWUlaiVGJSNCUDp2JEdCUDF+JE4/V0IuGyhC?=
which should be decoded like:
管理したセキュリティ対策で対応の迅速
const iconv = require('iconv-lite');
...
return iconv.decode(buf, fromCharset);
I'm going to throw in my vote here. I could use iso-2022-jp support
I also use MailParser and hope iconv-lite can support iso-2022-jp, many thanks
Please, add my vote as well.
Error: Encoding not recognized: 'ISO-2022-JP' (searched as: 'iso2022jp')
This issue has been open for a pretty long time :(
Would also like to add myself to the list of "someone asks".
Notes: both mailparser and libmime packages fixed iso-2022-jp decoding problem by importing encoding-japanese package:
vote
vote.
vote
vote
vote
Vote
FYI: I've ran into same issue and fixed it by importing already mentioned encoding-japanese
package.
Vote
Needs a separate, stateful codec, so probably will not implement without a sign of significant usage.