Commons Email
  1. Commons Email
  2. EMAIL-14

[email] not support content charset gb2312

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      when i try the example :
      Email email=new SimpleEmail();
      email.setHostName("129.1.1.129");
      email.setAuthentication("admin","1");
      email.addTo("wangjianquan@eastsoft.com.cn", "wjq");
      email.setFrom("admin@wjq.com", "Me");
      email.setCharset("gb2312");
      email.setSubject("²âÊÔ¼òµ¥Óʼþ");
      email.setMsg("ÕâÊDzâÊÔ¼òµ¥Óʼþ");
      email.send();

      the received mail content like "????????????" ,when change Email.TEXT_PLAIN
      = "text/plain" to TEXT_PLAIN = "text/plain;charset=gb2312" , all are right

        Issue Links

          Activity

          Hide
          Philip Jacob added a comment -

          Created an attachment (id=16629)
          Properly sets the value of setCharset() into the resultant email message

          That's a bug. The input to setCharset() is ignored in all cases. I'm trying
          to send mail in UTF-8 and I'm having a similar problem as the previous person.

          Here's a patch that fixes the problem.

          Show
          Philip Jacob added a comment - Created an attachment (id=16629) Properly sets the value of setCharset() into the resultant email message That's a bug. The input to setCharset() is ignored in all cases. I'm trying to send mail in UTF-8 and I'm having a similar problem as the previous person. Here's a patch that fixes the problem.
          Hide
          David Eric Pugh added a comment -

          From what it looks like, you are basically adding UTF-8 as another charset, correct?

          At this point we support thre charsets:
          /** */
          public static final String KOI8_R = "koi8-r";
          /** */
          public static final String ISO_8859_1 = "iso-8859-1";
          /** */
          public static final String US_ASCII = "us-ascii";

          I am wondering if there is some sort of master list of charsets we should add. If we have KOI8_R, and
          are now adding UTF-8, what other obscure charsets should we take care off?

          Show
          David Eric Pugh added a comment - From what it looks like, you are basically adding UTF-8 as another charset, correct? At this point we support thre charsets: /** */ public static final String KOI8_R = "koi8-r"; /** */ public static final String ISO_8859_1 = "iso-8859-1"; /** */ public static final String US_ASCII = "us-ascii"; I am wondering if there is some sort of master list of charsets we should add. If we have KOI8_R, and are now adding UTF-8, what other obscure charsets should we take care off?
          Hide
          Yoshiyuki Mikami added a comment -

          (In reply to comment #2)
          > From what it looks like, you are basically adding UTF-8 as another charset,
          correct?
          >
          > At this point we support thre charsets:
          > /** */
          > public static final String KOI8_R = "koi8-r";
          > /** */
          > public static final String ISO_8859_1 = "iso-8859-1";
          > /** */
          > public static final String US_ASCII = "us-ascii";
          >
          > I am wondering if there is some sort of master list of charsets we should add.
          If we have KOI8_R, and
          > are now adding UTF-8, what other obscure charsets should we take care off?

          Hello, I'm Japanese.
          We usually use "ISO-2022-JP" when using Japanese.
          Please add this to list.

          Show
          Yoshiyuki Mikami added a comment - (In reply to comment #2) > From what it looks like, you are basically adding UTF-8 as another charset, correct? > > At this point we support thre charsets: > /** */ > public static final String KOI8_R = "koi8-r"; > /** */ > public static final String ISO_8859_1 = "iso-8859-1"; > /** */ > public static final String US_ASCII = "us-ascii"; > > I am wondering if there is some sort of master list of charsets we should add. If we have KOI8_R, and > are now adding UTF-8, what other obscure charsets should we take care off? Hello, I'm Japanese. We usually use "ISO-2022-JP" when using Japanese. Please add this to list.
          Hide
          Yoshiyuki Mikami added a comment -

          Created an attachment (id=17239)
          patch for "order fixed calling methods".

          Hello Philip,
          I applied the patch you made.
          But other problem cames up then.
          The problem is "order of calling method would be fixed statically".

          For example...
          1 email.setCharset("gb2312");
          2 email.setMsg("foo");
          3 email.setCharset("ISO-2022-JP");

          In this case, charset "ISO-2022-JP" won't be used. then I tried to make patch
          for this problem.

          Please check it, and give me some comments.
          Thank you.

          Show
          Yoshiyuki Mikami added a comment - Created an attachment (id=17239) patch for "order fixed calling methods". Hello Philip, I applied the patch you made. But other problem cames up then. The problem is "order of calling method would be fixed statically". For example... 1 email.setCharset("gb2312"); 2 email.setMsg("foo"); 3 email.setCharset("ISO-2022-JP"); In this case, charset "ISO-2022-JP" won't be used. then I tried to make patch for this problem. Please check it, and give me some comments. Thank you.
          Hide
          Ben Speakmon added a comment -

          Adding link to related issue.

          Show
          Ben Speakmon added a comment - Adding link to related issue.
          Hide
          Ben Speakmon added a comment -

          I've submitted a patch for this issue in EMAIL-54.

          Show
          Ben Speakmon added a comment - I've submitted a patch for this issue in EMAIL-54 .
          Hide
          dion gillard added a comment -

          Fixed by EMAIL-54 patch

          Show
          dion gillard added a comment - Fixed by EMAIL-54 patch

            People

            • Assignee:
              Unassigned
              Reporter:
              locka
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development