DecoderUtil.decodeEncodedWords can not decode the encoded-test starts with "="
------------------------------------------------------------------------------

                 Key: MIME4J-144
                 URL: https://issues.apache.org/jira/browse/MIME4J-144
             Project: JAMES Mime4j
          Issue Type: Bug
          Components: project
    Affects Versions: 0.6
            Reporter: Nevin


In Rfc 2047, the encoded word is described as below: 
    encoded-word = "=?" charset "?" encoding "?" encoded-text "?="

If the encoding is Q and the encoded-test starts with "=",  
DecoderUtil.decodeEncodedWords can not parse the word correctly. 

For example: 
        String fieldValue = EncoderUtil.encodeEncodedWord("中国", 
Usage.TEXT_TOKEN, 0, Charset.forName("gb2312"),Encoding.Q);        
        System.out.println(fieldValue);
        System.out.println(DecoderUtil.decodeEncodedWords(fieldValue));
    The output is :
       =?GB2312?Q?=D6=D0=B9=FA?=
       =?GB2312?Q?=D6=D0=B9=FA?=
     In fact the second line of the output should be the original word 中国.




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

Reply via email to