You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Stefano Bagnara (JIRA)" <se...@james.apache.org> on 2008/07/21 11:45:32 UTC

[jira] Commented: (MIME4J-63) QuotedPrintable encoder fails on 8bit bytes

    [ https://issues.apache.org/jira/browse/MIME4J-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615183#action_12615183 ] 

Stefano Bagnara commented on MIME4J-63:
---------------------------------------

I had to change CodecUtil this way, maybe it helps you (or double check your work).
-------------
        private void escape(byte next) throws IOException {
            if (--nextSoftBreak <= QUOTED_PRINTABLE_OCTETS_PER_ESCAPE) {
                softBreak();
            }
>>> int nextUnsigned = next;
>>> if (nextUnsigned < 0) nextUnsigned += 256;
            write(EQUALS);
            --nextSoftBreak;
            write(HEX_DIGITS[nextUnsigned >> 4]);
            --nextSoftBreak;
            write(HEX_DIGITS[nextUnsigned % 0x10]);
        }
--------------------- 
(sorry this is not a diff, but I have too many changes in this file locally)

> QuotedPrintable encoder fails on 8bit bytes
> -------------------------------------------
>
>                 Key: MIME4J-63
>                 URL: https://issues.apache.org/jira/browse/MIME4J-63
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: qp-body.msg, qp-body_decoded.xml, qp-body_decoded_1.txt
>
>
> CodecUtil - BinaryQuotedPrintableEncoder treat incoming char (casted to bytes) as unsigned while they are signed.
> Thus throwing OOBE on non 7bit content.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org