ashtuchkin / iconv-lite

Convert character encodings in pure javascript.
MIT License
3.07k stars 282 forks source link

Add ISO-2022-JP encoding #60

Open ashtuchkin opened 10 years ago

ashtuchkin commented 10 years ago

Needs a separate, stateful codec, so probably will not implement without a sign of significant usage.

max-mapper commented 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')]
max-mapper commented 10 years ago

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

ashtuchkin commented 10 years ago

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 .

coyle commented 9 years ago

I'll throw my vote in here. Just ran into the same error.

ashtuchkin commented 9 years ago

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 .

AVVS commented 9 years ago

Would love to get it supported as well :+1:

bitinn commented 9 years ago

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 :)

asleepysamurai commented 9 years ago

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.

lygstate commented 8 years ago

vote for this.

AdrianTudC commented 8 years ago

I also vote for this, it would be great to have since i run into this problem every time i deal with japanese emails.

Atm0sf3ar commented 7 years ago

You get my vote. Just ran into this issue.

nnabinh commented 6 years ago

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! 💀

kevincupp commented 6 years ago

Another vote! Also dealing with emails.

issei-m commented 6 years ago

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.

mazamachi commented 6 years ago

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!

misteral commented 5 years ago

My vote for this.

kenjiuno commented 5 years ago

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:

const iconv = require('iconv-lite');
...
        return iconv.decode(buf, fromCharset);

https://github.com/nodemailer/libmime/blob/a0a84a429e68f206bae4172c4cc1a38d3930c369/lib/charset.js#L37

mjmayer commented 5 years ago

I'm going to throw in my vote here. I could use iso-2022-jp support

chenxiaoba commented 4 years ago

I also use MailParser and hope iconv-lite can support iso-2022-jp, many thanks

DigitalLeaves commented 4 years ago

Please, add my vote as well.

Error: Encoding not recognized: 'ISO-2022-JP' (searched as: 'iso2022jp')

CExAdamJ commented 4 years ago

This issue has been open for a pretty long time :(

Would also like to add myself to the list of "someone asks".

kenjiuno commented 3 years ago

Notes: both mailparser and libmime packages fixed iso-2022-jp decoding problem by importing encoding-japanese package:

voccer commented 3 years ago

vote

mayurbangar commented 2 years ago

vote.

kght6123 commented 1 year ago

vote

1shiharat commented 1 year ago

vote

julianmesa-gitkraken commented 1 year ago

vote

ntafra00 commented 1 year ago

Vote

FYI: I've ran into same issue and fixed it by importing already mentioned encoding-japanese package.

erica4appz commented 5 months ago

Vote