node-imap icon indicating copy to clipboard operation
node-imap copied to clipboard

part params and part disposition.params do not decode MIME quoted-word strings.

Open michaelabuckley opened this issue 6 years ago • 2 comments

Encoded part params wind up raw. Actual: { name: '=?UTF-8?Q?Co=CC=82te=CC=81.pdf?=', 'x-unix-mode': '0644' } Expected: { name: 'Côté.pdf', 'x-unix-mode': '0644' }

michaelabuckley avatar Nov 19 '19 21:11 michaelabuckley

  • =?UTF-8?Q? ..text.. ?= "Q" -> QuotedPrintable encoded

Just use : var quotedPrintable = require('quoted-printable'); var utf8 = require('utf8'); And do utf8.decode(quotedPrintable.decode('Co=CC=82te=CC=81.pdf'))

nicorch avatar Dec 05 '19 15:12 nicorch

Thanks @nicorch. I'm using libmime.decodeWords(filename).normalize() as a workaround.

The rest of the headers returned by node-imap are decoded by internally. I suspect this won't get fixed until I write a patch. ;-)

michaelabuckley avatar Dec 16 '19 18:12 michaelabuckley