You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/02/13 13:03:18 UTC
[GitHub] [camel] davsclaus commented on a change in pull request #6940: add test for multiple text attachments but different charsets
davsclaus commented on a change in pull request #6940:
URL: https://github.com/apache/camel/pull/6940#discussion_r805332035
##########
File path: components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java
##########
@@ -146,6 +146,62 @@ public void roundtripWithTextAttachmentsAndSpecialCharacters() throws IOExceptio
assertEquals(attText, new String(os.toByteArray()));
}
+ @Test
+ public void roundtripWithMultipleTextAttachmentsButDifferentCharsets() throws IOException {
+ String att1ContentType = "text/plain; charset=ISO-8859-1";
+ String att1Text = new String("empfänger1".getBytes("ISO-8859-1"), "ISO-8859-1");
+ String att1FileName = "empfänger1";
+ String att2ContentType = "text/plain; charset=ISO-8859-15";
+ String att2Text = new String("empfänger15".getBytes("ISO-8859-15"), "ISO-8859-15");
+ String att2FileName = "empfänger15";
Review comment:
When you have string text that uses non-ascii then you should unicode escape those, eg "aaa\u1234\u5555"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org