Skip to content

Commit 17c4f1c

Browse files
committed
decode html and text body messages that also include unicode characters
1 parent 9f5e2a1 commit 17c4f1c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,8 +861,8 @@ function read(
861861

862862
try {
863863
if (encoding === 'base64') {
864-
result.html = Base64.decode(result.html);
865-
}
864+
result.html = Base64.decode(result.html);
865+
}
866866
else if (Base64.btoa(Base64.atob(result.html)) == result.html) {
867867
result.html = Base64.atob(result.html);
868868
}

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe('readEml should decode', () => {
131131
expect(readEmlJson.attachments[0].name).to.equal('image.png');
132132
});
133133

134-
it('base64 encoded html body', () => {
134+
it('base64 encoded text and html body', () => {
135135
const readEmlJson = readEmlForTest('./fixtures/unicode.eml');
136136
expect(readEmlJson.text).to.contain('コピーボタンをクリックすると');
137137
expect(readEmlJson.html).to.contain('コピーボタンをクリックすると');

0 commit comments

Comments
 (0)