You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Edvin Syse (JIRA)" <ji...@apache.org> on 2008/05/26 15:37:56 UTC

[jira] Created: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
------------------------------------------------------------------------------------------------------------------

                 Key: EMAIL-79
                 URL: https://issues.apache.org/jira/browse/EMAIL-79
             Project: Commons Email
          Issue Type: Bug
    Affects Versions: 1.1
         Environment: Windows Vista, JDK 1.6.0_06
            Reporter: Edvin Syse
            Priority: Minor


When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.

Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

Posted by "Corey Scott (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EMAIL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Corey Scott updated EMAIL-79:
-----------------------------

    Attachment: EMAIL-79-patch.txt

Edvin,

I am not sure this is what you wanted but the changes contained are making the simple (and HTML) email classes utilize the charset and content type settings better than they were. (in some cases they werent being used previously)

You still have to do a email.setCharset() call in order to ensure both the subject and message bodies have the encoding set but I personally feel this is acceptable.  Perhaps because I dont see how the encoding can be reliably determined dynamically or even if it could, it is in side the scope of this library.

> SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMAIL-79
>                 URL: https://issues.apache.org/jira/browse/EMAIL-79
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Windows Vista, JDK 1.6.0_06
>            Reporter: Edvin Syse
>            Priority: Minor
>         Attachments: EMAIL-79-patch.txt, EmailTest.zip
>
>
> When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.
> Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

Posted by "Edvin Syse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EMAIL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650486#action_12650486 ] 

Edvin Syse commented on EMAIL-79:
---------------------------------

Please se attached MailTest.java and message.eml and the resulting email when recieved. You need to put commons-email-1.1.jar and mail-1.4.jar on the classpath to run the test. As you see, the subject is encoded correctly, but the body is qp-encoded with latin-1 charset instead of UTF-8. I ran the program with -Dfile.encoding="UTF-8". It's easy to spot, since the each qp-encoded letter in the body only consist of one encoded one-byte sequence instead of two.

> SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMAIL-79
>                 URL: https://issues.apache.org/jira/browse/EMAIL-79
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Windows Vista, JDK 1.6.0_06
>            Reporter: Edvin Syse
>            Priority: Minor
>         Attachments: EmailTest.zip
>
>
> When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.
> Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

Posted by "Edvin Syse (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EMAIL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Edvin Syse updated EMAIL-79:
----------------------------

    Attachment: EmailTest.zip

> SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMAIL-79
>                 URL: https://issues.apache.org/jira/browse/EMAIL-79
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Windows Vista, JDK 1.6.0_06
>            Reporter: Edvin Syse
>            Priority: Minor
>         Attachments: EmailTest.zip
>
>
> When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.
> Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EMAIL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl updated EMAIL-79:
-----------------------------------

    Fix Version/s: 1.2

> SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMAIL-79
>                 URL: https://issues.apache.org/jira/browse/EMAIL-79
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Windows Vista, JDK 1.6.0_06
>            Reporter: Edvin Syse
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: EMAIL-79-patch-v2.txt, EMAIL-79-patch.txt, EmailTest.zip
>
>
> When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.
> Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

Posted by "Corey Scott (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EMAIL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650445#action_12650445 ] 

Corey Scott commented on EMAIL-79:
----------------------------------

Edvin,

I tried looking into this for you and were unable to come up with a test to prove this condition.
Could you please see if you can create one so I can move this forward for you?

Thanks

> SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMAIL-79
>                 URL: https://issues.apache.org/jira/browse/EMAIL-79
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Windows Vista, JDK 1.6.0_06
>            Reporter: Edvin Syse
>            Priority: Minor
>
> When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.
> Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EMAIL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671232#action_12671232 ] 

Siegfried Goeschl commented on EMAIL-79:
----------------------------------------

I applied the patch but it is breaking a few tests

  testSendNoAttachments(org.apache.commons.mail.SendWithAttachmentsTest)
  testSendWAttachments(org.apache.commons.mail.SendWithAttachmentsTest)
  testSend(org.apache.commons.mail.HtmlEmailTest)
  testSend2(org.apache.commons.mail.HtmlEmailTest)
  testHtmlMailMimeLayout(org.apache.commons.mail.EmailLiveTest)
  testSend(org.apache.commons.mail.MultiPartEmailTest)

I try to commit my pending changes so that you can have a look at the problems

> SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMAIL-79
>                 URL: https://issues.apache.org/jira/browse/EMAIL-79
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Windows Vista, JDK 1.6.0_06
>            Reporter: Edvin Syse
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>         Attachments: EMAIL-79-patch.txt, EmailTest.zip
>
>
> When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.
> Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EMAIL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl resolved EMAIL-79.
------------------------------------

    Resolution: Fixed

Works now - thx

> SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMAIL-79
>                 URL: https://issues.apache.org/jira/browse/EMAIL-79
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Windows Vista, JDK 1.6.0_06
>            Reporter: Edvin Syse
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: EMAIL-79-patch-v2.txt, EMAIL-79-patch.txt, EmailTest.zip
>
>
> When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.
> Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

Posted by "Corey Scott (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EMAIL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Corey Scott updated EMAIL-79:
-----------------------------

    Attachment: EMAIL-79-patch-v2.txt

New version of the patch that replaces the earlier one.

Tests against the current trunk are working again.

> SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMAIL-79
>                 URL: https://issues.apache.org/jira/browse/EMAIL-79
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Windows Vista, JDK 1.6.0_06
>            Reporter: Edvin Syse
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>         Attachments: EMAIL-79-patch-v2.txt, EMAIL-79-patch.txt, EmailTest.zip
>
>
> When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.
> Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

Posted by "Corey Scott (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EMAIL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652237#action_12652237 ] 

Corey Scott commented on EMAIL-79:
----------------------------------

That certainly seems logical. :-)

> SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMAIL-79
>                 URL: https://issues.apache.org/jira/browse/EMAIL-79
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Windows Vista, JDK 1.6.0_06
>            Reporter: Edvin Syse
>            Priority: Minor
>         Attachments: EMAIL-79-patch.txt, EmailTest.zip
>
>
> When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.
> Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (EMAIL-79) SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly

Posted by "Edvin Syse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EMAIL-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651997#action_12651997 ] 

Edvin Syse commented on EMAIL-79:
---------------------------------

Thanks, hopefully that will do the trick! I agree that one cannot always determine the correct encoding, but I think it is reasonable that the same encoding should be used in both subject and body even if you don't supply something explicitely, don't you agree?


> SimpleEmail#setMsg() with UTF-8 content honors correct charset in header, but doesn't encode the content correctly
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMAIL-79
>                 URL: https://issues.apache.org/jira/browse/EMAIL-79
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: Windows Vista, JDK 1.6.0_06
>            Reporter: Edvin Syse
>            Priority: Minor
>         Attachments: EMAIL-79-patch.txt, EmailTest.zip
>
>
> When I create a new SimpleEmail and use setMsg(some-utf8-text), the Content-Type header of the generated email correctly changes to UTF-8, but the content is not encoded correctly.
> Adding setCharset("UTF-8") solves the problem, but that shouldn't be needed, as the change of Content-Type header indicates.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.