Skip to content

Commit

Permalink
#17: Updated rtf-to-html dependency which fixed support for older UTF…
Browse files Browse the repository at this point in the history
…-8 character set name
  • Loading branch information
Benny Bottema authored and Benny Bottema committed Oct 22, 2019
1 parent 700a83a commit cb709e3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<dependency>
<groupId>com.github.bbottema</groupId>
<artifactId>rtf-to-html</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>

<!-- logging -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public void testEmbeddedImage()
+ " \n"
+ "\n");
}

@Test
public void testChineseMessage()
throws IOException {
Expand Down Expand Up @@ -478,6 +478,36 @@ public void testChineseMessage()
" \n");
}

@Test
public void testUnicodeMessage()
throws IOException {
OutlookMessage msg = parseMsgFile("test-messages/tst_unicode.msg");
OutlookMessageAssert.assertThat(msg).hasFromName("m.kalejs@outlook.com");
OutlookMessageAssert.assertThat(msg).hasFromEmail("m.kalejs@outlook.com");
OutlookMessageAssert.assertThat(msg).hasSubject("Testcase");
OutlookMessageAssert.assertThat(msg).hasToName("doesnotexist@doesnt.com");
OutlookMessageAssert.assertThat(msg).hasToEmail(null);
List<OutlookAttachment> outlookAttachments = msg.getOutlookAttachments();
assertThat(outlookAttachments).isEmpty();
assertThat(msg.getBodyText()).isNotEmpty();
assertThat(msg.getBodyHTML()).isNull();
assertThat(msg.fetchCIDMap()).isEmpty();
assertThat(msg.fetchTrueAttachments()).isEmpty();
assertThat(normalizeText(msg.getBodyText())).isEqualTo("-/-\n" +
"Char-å-Char\n" +
"-/-\n" +
"Char-Å-Char\n" +
"-/-\n" +
"Char-ø-Char\n" +
"-/-\n" +
"Char-Ø-Char\n" +
"-/-\n" +
"Char-æ-Char\n" +
"-/-\n" +
"Char-Æ-Char\n" +
" \n");
}

@Test
public void testMsgForwardDraftWithBothAttachmentsAndEmbeddedImage()
throws IOException {
Expand Down
Binary file not shown.

0 comments on commit cb709e3

Please sign in to comment.