Decode QOutlook legacy MIME words

This commit is contained in:
Курнат Андрей
2026-06-01 08:22:01 +03:00
parent cf3d6b0b01
commit 472288badf
3 changed files with 12 additions and 14 deletions
+3
View File
@@ -37,6 +37,9 @@ describe("outlookMail helpers", () => {
it("декодирует UTF-8 MIME words и transfer encodings", () => {
expect(decodeMimeWords("=?UTF-8?B?0J/RgNC40LLQtdGC?=")).toBe("Привет");
expect(decodeMimeWords("=?windows-1251?B?z/Do4uXy?=")).toBe("Привет");
expect(decodeMimeWords("=?windows-1251?Q?=CF=F0=E8=E2=E5=F2?=")).toBe("Привет");
expect(decodeMimeWords("=?UTF-8?B?0J/RgNC4?= =?UTF-8?B?0LLQtdGC?=")).toBe("Привет");
expect(decodeTransferBody("0J/RgNC40LLQtdGC", "base64")).toBe("Привет");
expect(decodeTransferBody("=D0=9F=D1=80=D0=B8=D0=B2=D0=B5=D1=82", "quoted-printable")).toBe("Привет");
});