You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Java John (JIRA)" <ji...@apache.org> on 2011/04/22 00:57:05 UTC

[jira] [Created] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
-----------------------------------------------------------------------------------------------------

                 Key: CODEC-121
                 URL: https://issues.apache.org/jira/browse/CODEC-121
             Project: Commons Codec
          Issue Type: Bug
    Affects Versions: 1.5
         Environment: I tested on Windows 7.
            Reporter: Java John


Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
There example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example

test:

  String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
		    "mathematics is the most beautiful branch of philosophy.";

  String expected = "If you believe that truth=beauty, then surely " +
		    "mathematics is the most beautiful branch of philosophy.";

  assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );

I suppose I could fix if you like but currently I'm not a registered developer.  




--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13023307#comment-13023307 ] 

Gary D. Gregory commented on CODEC-121:
---------------------------------------

Feel free to submit a patch here. Thank you.

> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Thomas Neidhart (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart updated CODEC-121:
----------------------------------

    Attachment: CODEC-121_postponed.patch

Attached the reverted changes for later inclusion.
                
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5, 1.6
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 2.0
>
>         Attachments: CODEC-121_postponed.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

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

Java John updated CODEC-121:
----------------------------

    Description: 
Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example

test:

  String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
		    "mathematics is the most beautiful branch of philosophy.";

  String expected = "If you believe that truth=beauty, then surely " +
		    "mathematics is the most beautiful branch of philosophy.";

  assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );

I suppose I could fix if you like but currently I'm not a registered developer.  




  was:
Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
There example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example

test:

  String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
		    "mathematics is the most beautiful branch of philosophy.";

  String expected = "If you believe that truth=beauty, then surely " +
		    "mathematics is the most beautiful branch of philosophy.";

  assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );

I suppose I could fix if you like but currently I'm not a registered developer.  





> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Thomas Neidhart (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart reopened CODEC-121:
-----------------------------------


Postponed to 2.0 due to incompatibility with prior releases of 1.x
                
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5, 1.6
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 2.0
>
>         Attachments: CODEC-121.patch, CODEC-121_v2.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Thomas Neidhart (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart updated CODEC-121:
----------------------------------

    Fix Version/s:     (was: 1.7)
                   2.0
    
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5, 1.6
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 2.0
>
>         Attachments: CODEC-121.patch, CODEC-121_v2.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Gary D. Gregory (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved CODEC-121.
-----------------------------------

    Resolution: Fixed

Patch applied with slight modifications. Thank you!
                
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.x
>
>         Attachments: CODEC-121.patch, CODEC-121_v2.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028913#comment-13028913 ] 

Gary D. Gregory commented on CODEC-121:
---------------------------------------

Note that the class is documented as not implementing soft line breaks:
{quote}
Rules #3, #4, and #5 of the quoted-printable spec are not implemented yet because the complete quoted-printable spec does not lend itself well into the byte[] oriented codec framework. Complete the codec once the streamable codec framework is ready. The motivation behind providing the codec in a partial form is that it can already come in handy for those applications that do not require quoted-printable line formatting (rules #3, #4, #5), for instance Q codec. 
{quote}

> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Thomas Neidhart (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222203#comment-13222203 ] 

Thomas Neidhart commented on CODEC-121:
---------------------------------------

Hi Gary,

the latest commit to codec was 1296456, and the patch was created from 1296812 (using svn diff files > patch).
When I apply the patch myself (patch -p0 < patch), I get the following message:

{noformat}
patching file src/main/java/org/apache/commons/codec/net/QuotedPrintableCodec.java
Hunk #1 succeeded at 42 with fuzz 1.
patching file src/test/java/org/apache/commons/codec/net/QuotedPrintableCodecTest.java
{noformat}

The result is ok. The revision number will continue to increase even if there are no commits to codec, or am I doing something wrong?
                
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.x
>
>         Attachments: CODEC-121.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Gary D. Gregory (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory updated CODEC-121:
----------------------------------

    Fix Version/s:     (was: 1.6)
                   1.x
    
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.x
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Java John (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222703#comment-13222703 ] 

Java John commented on CODEC-121:
---------------------------------


Thanks Thomas.  I would have liked to get back to this one but have too many other issues on my plate.  This was a low priority for me.

Nice work!

John


 		 	   		  

                
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.x
>
>         Attachments: CODEC-121.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Java John (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028991#comment-13028991 ] 

Java John commented on CODEC-121:
---------------------------------


Yes, but I think it should.  It does not look good that the example the world is likely to see if one search for this stuff is not supported.

I do not have time to work on this now but I may get a chance to in a few weeks.  

john



 		 	   		  


> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Thomas Neidhart (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart updated CODEC-121:
----------------------------------

    Attachment: CODEC-121.patch

Hi,

I worked on this issue and came up with a patch to fully support the quoted-printable spec.

There are some simplifications to keep the code still simple and small:

 * do not split on words like in the wikipedia example, but rather at a fixed position
 * break at position 73 rather than filling up to pos 76 if possible
 * treat last two octets separately to simplify the rule that '=' must not be the ultimate or penultimate character
                
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.x
>
>         Attachments: CODEC-121.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029023#comment-13029023 ] 

Gary D. Gregory commented on CODEC-121:
---------------------------------------

Sounds good John. See you then. 

> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Gary D. Gregory (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory updated CODEC-121:
----------------------------------

    Fix Version/s:     (was: 1.6.1)
                   1.7
    
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5, 1.6
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.7
>
>         Attachments: CODEC-121.patch, CODEC-121_v2.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Gary D. Gregory (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222099#comment-13222099 ] 

Gary D. Gregory commented on CODEC-121:
---------------------------------------

Hello Thomas,

Thank you for the patch. Could you please create it against the latest from trunk please? I am getting errors applying the patch as it is.

Gary
                
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.x
>
>         Attachments: CODEC-121.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Gary D. Gregory (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory updated CODEC-121:
----------------------------------

    Affects Version/s: 1.6
        Fix Version/s:     (was: 1.x)
                       1.6.1
    
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5, 1.6
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.6.1
>
>         Attachments: CODEC-121.patch, CODEC-121_v2.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Thomas Neidhart (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart updated CODEC-121:
----------------------------------

    Attachment: CODEC-121_v2.patch

Hi Gary,

I have updated the patch, it now gets 100% test coverage.

Additionally, I have added a missing case of not encoded whitespace before a soft break and moved some repeated code into dedicated private methods to make the code more readable.
                
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.x
>
>         Attachments: CODEC-121.patch, CODEC-121_v2.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Thomas Neidhart (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart updated CODEC-121:
----------------------------------

    Attachment:     (was: CODEC-121_v2.patch)
    
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5, 1.6
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 2.0
>
>         Attachments: CODEC-121_postponed.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Henri Yandell (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated CODEC-121:
--------------------------------

         Fix Version/s: 1.6
    Remaining Estimate:     (was: 2h)
     Original Estimate:     (was: 2h)

Assigning to 1.6, but going to depend on whether anyone wants to sit and code a solution.
                
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.6
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Gary D. Gregory (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222674#comment-13222674 ] 

Gary D. Gregory commented on CODEC-121:
---------------------------------------

Hi Thomas,

I was able to apply the patch after increasing the fuzz factor from 0 to 1.

The next issue is that, while the patch applies and the tests pass, we've now lost some code coverage.

You can see 100% code coverage for QuotedPrintableCodec here: http://commons.apache.org/codec/cobertura/index.html

With this patch, we have a couple of holes and the coverage goes down to 97/90 for line/branch coverage.

I'd like to keep QuotedPrintableCodec at 100/100.

Can you provide a patch that keeps code coverage at 100/100?

Thank you!

Gary
                
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 1.x
>
>         Attachments: CODEC-121.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CODEC-121) QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia

Posted by "Thomas Neidhart (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart updated CODEC-121:
----------------------------------

    Attachment:     (was: CODEC-121.patch)
    
> QuotedPrintableCodec does not support soft line break per the 'quoted-printable' example on Wikipedia
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-121
>                 URL: https://issues.apache.org/jira/browse/CODEC-121
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.5, 1.6
>         Environment: I tested on Windows 7.
>            Reporter: Java John
>              Labels: codec, decode, quoted-printable
>             Fix For: 2.0
>
>         Attachments: CODEC-121_v2.patch
>
>
> Writing a unit test I discovered that the example Wikipedia uses for quoted-printable data does not decode but instead throws an exception.  
> Their example is here:  http://en.wikipedia.org/wiki/Quoted-printable#Example
> test:
>   String qpdata   = "If you believe that truth=3Dbeauty, then surely=20=\r\n" +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   String expected = "If you believe that truth=beauty, then surely " +
> 		    "mathematics is the most beautiful branch of philosophy.";
>   assertEquals( expected,  new QuotedPrintableCodec().decode(qpdata) );
> I suppose I could fix if you like but currently I'm not a registered developer.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira