FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=15960&edit=1

ID: 15960
Updated by: alan@akbkhome.com
Reported By: rhyde at hydenetworks dot com
Summary: PATCH: mimeDecode ignores character encoding/charset
Status: Open
Type: Bug
Package: Mail_mimeDecode
Operating System: FreeBSD
PHP Version: 5.2.8
Roadmap Versions:
New Comment:

Looking at this, the decoder returns information about the byte string,
including what character set it
uses.

I think it should be the responsibility of the callee to do conversions
on this data, Providing a helper
method may be a viable option here. but doing the encoding in-line is
error prone. and may lead to data
being lost.

Considering flagging as 'expected behaviour'


Previous Comments:
------------------------------------------------------------------------

[2009-08-26 07:41:33] cweiske

I do have the demo code on my machine.

------------------------------------------------------------------------

[2009-08-26 07:41:09] cweiske

-Status: Feedback
+Status: Open


------------------------------------------------------------------------

[2009-08-25 22:19:04] treyhyde

nm, I think I'm feeling my frustration with this system from March boil
up again. It's munging all the encoded data. I'll email.

------------------------------------------------------------------------

[2009-08-25 22:17:57] treyhyde

test data:
Message-Id: <2FE6A643-1B7A-46F0-A94A-D13A0CF5470F@centraldesktop.com>
From: Trey Hyde <thyde@centraldesktop.com>
To: folder.0.20919.general@in.th.centraldesktop-dev.com
Content-Type: multipart/alternative;
boundary=Apple-Mail-7-807266768
X-Smtp-Server: mail0.centraldesktop.com:thyde@centraldesktop.com
Mime-Version: 1.0 (Apple Message framework v930.3)
Subject: =?GB18030?B?pKrWqqTppLs=?=
Date: Wed, 11 Mar 2009 16:01:44 -0700


--Apple-Mail-7-807266768
Content-Type: text/plain;
charset=GB18030;
format=flowed
Content-Transfer-Encoding: base64

jI+Wy4ZUoaKls6XhpfOlxqlgpb+pYKTPNdTCNsjVpN6kx8S8vK+kt6TepLmhow0K05vKwqTOpail
86XIpeqpYKTPM9TCOMjVpKuk6TXUwjbI1aTepMekyKTKpOqk3qS5oaOKXqTDpMaktLLOvNOkr6TA
pLWkpKGjDQoNCg0KDQpUcmV5IEh5ZGUNCnRoeWRlQGNlbnRyYWxkZXNrdG9wLmNvbQ0KQ2VudHJh
bCBEZXNrdG9wLCBJbmMuDQpPcmdhbml6ZSwgU2hhcmUsIENvbGxhYm9yYXRlDQoNCg==

--Apple-Mail-7-807266768
Content-Type: text/html;
charset=GB18030
Content-Transfer-Encoding: quoted-printable

<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><div><span =
class=3D"Apple-style-span" style=3D"font-family: -webkit-sans-serif; =
font-size: 15px; line-height: 22px; "><ul style=3D"line-height: 1.5em;
=
list-style-type: square; margin-top: 0.3em; margin-right: 0px; =
margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right:
=
0px; padding-bottom: 0px; padding-left: 0px; list-style-image: =
url(http://ja.wikipedia.org/skins-1.5/monobook/bullet.gif); "><li =
style=3D"margin-bottom: 0.1em; =
">=8C=8F=96=CB=86T=A1=A2=A5=B3=A5=E1=A5=F3=A5=C6=A9`=A5=BF=A9`=A4=CF5=D4=C2=
6=C8=D5=A4=DE=A4=C7=C4=BC=BC=AF=A4=B7=A4=DE=A4=B9=A1=A3</li><li =
style=3D"margin-bottom: 0.1em; =
">=D3=9B=CA=C2=A4=CE=A5=A8=A5=F3=A5=C8=A5=EA=A9`=A4=CF3=D4=C28=C8=D5=A4=AB=
=A4=E95=D4=C26=C8=D5=A4=DE=A4=C7=A4=C8=A4=CA=A4=EA=A4=DE=A4=B9=A1=A3=8A^=A4=
=C3=A4=C6=A4=B4=B2=CE=BC=D3=A4=AF=A4=C0=A4=B5=A4=A4=A1=A3</li></ul></span>=
</div><div><br></div><div><br></div><br><div =
apple-content-edited=3D"true"> <span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; =
white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing:
=
0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust:
=
auto; -webkit-text-stroke-width: 0; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><div>Trey Hyde<br><a =
href=3D"mailto:thyde@centraldesktop.com">thyde@centraldesktop.com</a><br>C=
entral Desktop, Inc.<br>Organize, Share, Collaborate</div></div></span>
=
</div><br></body></html>=

--Apple-Mail-7-807266768--

------------------------------------------------------------------------

[2009-08-25 21:53:04] treyhyde

I had it all ready back in March but at that time this bug system wasn't
accepting my comments and there was no way to upload files that were not
patches. Let me see what I can dig up. It was pretty easy to
reproduce on any character set that wasn't 7bit compatible with ASCII.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=15960

Search Discussions

  • Alan at Sep 5, 2011 at 8:20 am
    Edit report at http://pear.php.net/bugs/bug.php?id=15960&edit=1

    ID: 15960
    Updated by: alan@akbkhome.com
    Reported By: rhyde at hydenetworks dot com
    Summary: PATCH: mimeDecode ignores character encoding/charset
    -Status: Open
    +Status: Feedback
    -Type: Bug
    +Type: Feature/Change Request
    Package: Mail_mimeDecode
    Operating System: FreeBSD
    PHP Version: 5.2.8
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Feedback
    -Type: Bug
    +Type: Feature/Change Request



    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-05 10:20:29] alan_k

    Looking at this, the decoder returns information about the byte string,
    including what character set it
    uses.

    I think it should be the responsibility of the callee to do conversions
    on this data, Providing a helper
    method may be a viable option here. but doing the encoding in-line is
    error prone. and may lead to data
    being lost.

    Considering flagging as 'expected behaviour'

    ------------------------------------------------------------------------

    [2009-08-26 07:41:33] cweiske

    I do have the demo code on my machine.

    ------------------------------------------------------------------------

    [2009-08-26 07:41:09] cweiske

    -Status: Feedback
    +Status: Open


    ------------------------------------------------------------------------

    [2009-08-25 22:19:04] treyhyde

    nm, I think I'm feeling my frustration with this system from March boil
    up again. It's munging all the encoded data. I'll email.

    ------------------------------------------------------------------------

    [2009-08-25 22:17:57] treyhyde

    test data:
    Message-Id: <2FE6A643-1B7A-46F0-A94A-D13A0CF5470F@centraldesktop.com>
    From: Trey Hyde <thyde@centraldesktop.com>
    To: folder.0.20919.general@in.th.centraldesktop-dev.com
    Content-Type: multipart/alternative;
    boundary=Apple-Mail-7-807266768
    X-Smtp-Server: mail0.centraldesktop.com:thyde@centraldesktop.com
    Mime-Version: 1.0 (Apple Message framework v930.3)
    Subject: =?GB18030?B?pKrWqqTppLs=?=
    Date: Wed, 11 Mar 2009 16:01:44 -0700


    --Apple-Mail-7-807266768
    Content-Type: text/plain;
    charset=GB18030;
    format=flowed
    Content-Transfer-Encoding: base64

    jI+Wy4ZUoaKls6XhpfOlxqlgpb+pYKTPNdTCNsjVpN6kx8S8vK+kt6TepLmhow0K05vKwqTOpail
    86XIpeqpYKTPM9TCOMjVpKuk6TXUwjbI1aTepMekyKTKpOqk3qS5oaOKXqTDpMaktLLOvNOkr6TA
    pLWkpKGjDQoNCg0KDQpUcmV5IEh5ZGUNCnRoeWRlQGNlbnRyYWxkZXNrdG9wLmNvbQ0KQ2VudHJh
    bCBEZXNrdG9wLCBJbmMuDQpPcmdhbml6ZSwgU2hhcmUsIENvbGxhYm9yYXRlDQoNCg==

    --Apple-Mail-7-807266768
    Content-Type: text/html;
    charset=GB18030
    Content-Transfer-Encoding: quoted-printable

    <html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space; "><div><span =
    class=3D"Apple-style-span" style=3D"font-family: -webkit-sans-serif; =
    font-size: 15px; line-height: 22px; "><ul style=3D"line-height: 1.5em;
    =
    list-style-type: square; margin-top: 0.3em; margin-right: 0px; =
    margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right:
    =
    0px; padding-bottom: 0px; padding-left: 0px; list-style-image: =
    url(http://ja.wikipedia.org/skins-1.5/monobook/bullet.gif); "><li =
    style=3D"margin-bottom: 0.1em; =
    ">=8C=8F=96=CB=86T=A1=A2=A5=B3=A5=E1=A5=F3=A5=C6=A9`=A5=BF=A9`=A4=CF5=D4=C2=
    6=C8=D5=A4=DE=A4=C7=C4=BC=BC=AF=A4=B7=A4=DE=A4=B9=A1=A3</li><li =
    style=3D"margin-bottom: 0.1em; =
    ">=D3=9B=CA=C2=A4=CE=A5=A8=A5=F3=A5=C8=A5=EA=A9`=A4=CF3=D4=C28=C8=D5=A4=AB=
    =A4=E95=D4=C26=C8=D5=A4=DE=A4=C7=A4=C8=A4=CA=A4=EA=A4=DE=A4=B9=A1=A3=8A^=A4=
    =C3=A4=C6=A4=B4=B2=CE=BC=D3=A4=AF=A4=C0=A4=B5=A4=A4=A1=A3</li></ul></span>=
    </div><div><br></div><div><br></div><br><div =
    apple-content-edited=3D"true"> <span class=3D"Apple-style-span" =
    style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
    Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
    font-weight: normal; letter-spacing: normal; line-height: normal; =
    orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; =
    white-space: normal; widows: 2; word-spacing: 0px; =
    -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing:
    =
    0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust:
    =
    auto; -webkit-text-stroke-width: 0; "><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space; "><div>Trey Hyde<br><a =
    href=3D"mailto:thyde@centraldesktop.com">thyde@centraldesktop.com</a><br>C=
    entral Desktop, Inc.<br>Organize, Share, Collaborate</div></div></span>
    =
    </div><br></body></html>=

    --Apple-Mail-7-807266768--

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=15960

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 5, '11 at 8:19a
activeSep 5, '11 at 8:20a
posts2
users1
websitepear.php.net

1 user in discussion

Alan: 2 posts

People

Translate

site design / logo © 2022 Grokbase