mscdex/node-imap — pull request #360 by chotiwat (2014-03-13 14:03:40+00:00)
Title: Fix premature decoding of encoded words ending with an incomplete multi-byte character

Hi.

It seems that Mail app for Windows 8 sometimes splits a multi-byte character into smaller multi-byte characters when it folds header lines. So ```Subject: abcdefghij ใน klmnopqr ไม่ขึ้น``` will become:
```
Subject: =?utf-8?Q?abcdefghij_=E0=B9=83=E0=B8=99_klmnopqr_=E0=B9=84=E0=B8=A1=E0=B9?=
=?utf-8?Q?=88=E0=B8=82=E0=B8=B6=E0=B9=89=E0=B8=99?=
```
Decoding each encoded word separately, we will get ```Subject: abcdefghij ใน klmnopqr ไม��``` and ```�ขึ้น``` respectively. This pull request try to fix this problem by joining consecutive encoded words that have the same charset and encoding together before decoding.

Thanks.