You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Kevan Miller <ke...@gmail.com> on 2006/06/08 14:28:09 UTC

Re: svn commit: r412426 - in /geronimo/specs/trunk/geronimo-spec-javamail/src: main/java/javax/mail/internet/ main/java/org/apache/geronimo/mail/util/ test/java/javax/mail/internet/

Rick,
If you're updating javamail, you need to update the version number  
for the javamail spec.
--kevan
On Jun 7, 2006, at 11:21 AM, rickmcguire@apache.org wrote:

> Author: rickmcguire
> Date: Wed Jun  7 08:21:46 2006
> New Revision: 412426
>
> URL: http://svn.apache.org/viewvc?rev=412426&view=rev
> Log:
> GERONIMO-2087 MimeUtility.encodeWord()/encodeText() have some errors.
>
>
> Modified:
>     geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/javax/ 
> mail/internet/MimeUtility.java
>     geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/ 
> apache/geronimo/mail/util/Base64Encoder.java
>     geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/ 
> apache/geronimo/mail/util/RFC2231Encoder.java
>     geronimo/specs/trunk/geronimo-spec-javamail/src/test/java/javax/ 
> mail/internet/MimeUtilityTest.java
>
> Modified: geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/ 
> javax/mail/internet/MimeUtility.java
> URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo- 
> spec-javamail/src/main/java/javax/mail/internet/MimeUtility.java? 
> rev=412426&r1=412425&r2=412426&view=diff
> ====================================================================== 
> ========
> --- geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/javax/ 
> mail/internet/MimeUtility.java (original)
> +++ geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/javax/ 
> mail/internet/MimeUtility.java Wed Jun  7 08:21:46 2006
> @@ -554,7 +554,7 @@
>              if (encoding.equalsIgnoreCase("B")) {
>                  encoder = "base64";
>              }
> -            else if (encoding.equalsIgnoreCase("G")) {
> +            else if (encoding.equalsIgnoreCase("Q")) {
>                  encoder = "quoted-printable";
>              }
>              else {
>
> Modified: geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/ 
> org/apache/geronimo/mail/util/Base64Encoder.java
> URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo- 
> spec-javamail/src/main/java/org/apache/geronimo/mail/util/ 
> Base64Encoder.java?rev=412426&r1=412425&r2=412426&view=diff
> ====================================================================== 
> ========
> --- geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/ 
> apache/geronimo/mail/util/Base64Encoder.java (original)
> +++ geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/ 
> apache/geronimo/mail/util/Base64Encoder.java Wed Jun  7 08:21:46 2006
> @@ -515,21 +515,22 @@
>              int readCount = in.read(inBuffer);
>              // did we get a full triplet?  that's an easy encoding.
>              if (readCount == 3) {
> -                byte a1 = (byte)(inBuffer[0] & 0xff);
> -                byte a2 = (byte)(inBuffer[1] & 0xff);
> -                byte a3 = (byte)(inBuffer[2] & 0xff);
> +                int  a1 = inBuffer[0] & 0xff;
> +                int  a2 = inBuffer[1] & 0xff;
> +                int  a3 = inBuffer[2] & 0xff;
>
>                  out.append((char)encodingTable[(a1 >>> 2) & 0x3f]);
>                  out.append((char)encodingTable[((a1 << 4) | (a2  
> >>> 4)) & 0x3f]);
>                  out.append((char)encodingTable[((a2 << 2) | (a3  
> >>> 6)) & 0x3f]);
>                  out.append((char)encodingTable[a3 & 0x3f]);
> +
>              }
>              else if (readCount <= 0) {
>                  // eof condition, don'e entirely.
>                  return;
>              }
>              else if (readCount == 1) {
> -                byte a1 = (byte)(inBuffer[0] & 0xff);
> +                int  a1 = inBuffer[0] & 0xff;
>                  out.append((char)encodingTable[(a1 >>> 2) & 0x3f]);
>                  out.append((char)encodingTable[(a1 << 4) & 0x3f]);
>                  out.append((char)padding);
> @@ -537,8 +538,8 @@
>                  return;
>              }
>              else if (readCount == 2) {
> -                byte a1 = (byte)(inBuffer[0] & 0xff);
> -                byte a2 = (byte)(inBuffer[1] & 0xff);
> +                int  a1 = inBuffer[0] & 0xff;
> +                int  a2 = inBuffer[1] & 0xff;
>
>                  out.append((char)encodingTable[(a1 >>> 2) & 0x3f]);
>                  out.append((char)encodingTable[((a1 << 4) | (a2  
> >>> 4)) & 0x3f]);
>
> Modified: geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/ 
> org/apache/geronimo/mail/util/RFC2231Encoder.java
> URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo- 
> spec-javamail/src/main/java/org/apache/geronimo/mail/util/ 
> RFC2231Encoder.java?rev=412426&r1=412425&r2=412426&view=diff
> ====================================================================== 
> ========
> --- geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/ 
> apache/geronimo/mail/util/RFC2231Encoder.java (original)
> +++ geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/ 
> apache/geronimo/mail/util/RFC2231Encoder.java Wed Jun  7 08:21:46 2006
> @@ -52,7 +52,7 @@
>              (byte)'8', (byte)'9', (byte)'A', (byte)'B', (byte)'C',  
> (byte)'D', (byte)'E', (byte)'F'
>          };
>
> -    protected String DEFAULT_SPECIALS = " *\\%";
> +    protected String DEFAULT_SPECIALS = " *'%";
>      protected String specials = DEFAULT_SPECIALS;
>
>      /*
> @@ -92,11 +92,11 @@
>          int bytesWritten = 0;
>          for (int i = off; i < (off + length); i++)
>          {
> -            byte ch = data[i];
> +            int ch = data[i] & 0xff;
>              // character tha must be encoded?  Prefix with a '%'  
> and encode in hex.
>              if (ch <= 32 || ch >= 127 || specials.indexOf(ch) !=  
> -1) {
>                  out.write((byte)'%');
> -                out.write(encodingTable[(ch >> 4)]);
> +                out.write(encodingTable[ch >> 4]);
>                  out.write(encodingTable[ch & 0xf]);
>                  bytesWritten += 3;
>              }
>
> Modified: geronimo/specs/trunk/geronimo-spec-javamail/src/test/java/ 
> javax/mail/internet/MimeUtilityTest.java
> URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo- 
> spec-javamail/src/test/java/javax/mail/internet/ 
> MimeUtilityTest.java?rev=412426&r1=412425&r2=412426&view=diff
> ====================================================================== 
> ========
> --- geronimo/specs/trunk/geronimo-spec-javamail/src/test/java/javax/ 
> mail/internet/MimeUtilityTest.java (original)
> +++ geronimo/specs/trunk/geronimo-spec-javamail/src/test/java/javax/ 
> mail/internet/MimeUtilityTest.java Wed Jun  7 08:21:46 2006
> @@ -83,4 +83,43 @@
>          }
>      }
>
> +
> +    public void testEncodeWord() throws Exception {
> +        assertEquals("abc", MimeUtility.encodeWord("abc"));
> +        // default code page dependent, hard to directly test the  
> encoded results
> +        assertEquals(" hé! àèôu !!!", MimeUtility.decodeWord 
> (MimeUtility.encodeWord(" hé! àèôu !!!")));
> +
> +        String encoded = MimeUtility.encodeWord(" hé! àèôu !!!",  
> "UTF-8", "Q");
> +        assertEquals("=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!? 
> =", encoded);
> +        assertEquals(" hé! àèôu !!!", MimeUtility.decodeWord 
> (encoded));
> +
> +        encoded = MimeUtility.encodeWord(" hé! àèôu !!!", "UTF-8",  
> "B");
> +        assertEquals("=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=",  
> encoded);
> +        assertEquals(" hé! àèôu !!!", MimeUtility.decodeWord 
> (encoded));
> +    }
> +
> +
> +    public void testEncodeText() throws Exception {
> +        assertEquals("abc", MimeUtility.encodeWord("abc"));
> +        // default code page dependent, hard to directly test the  
> encoded results
> +        assertEquals(" hé! àèôu !!!", MimeUtility.decodeText 
> (MimeUtility.encodeText(" hé! àèôu !!!")));
> +
> +        String encoded = MimeUtility.encodeText(" hé! àèôu !!!",  
> "UTF-8", "Q");
> +        assertEquals("=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!? 
> =", encoded);
> +        assertEquals(" hé! àèôu !!!", MimeUtility.decodeText 
> (encoded));
> +
> +        encoded = MimeUtility.encodeText(" hé! àèôu !!!", "UTF-8",  
> "B");
> +        assertEquals("=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=",  
> encoded);
> +        assertEquals(" hé! àèôu !!!", MimeUtility.decodeText 
> (encoded));
> +    }
> +
> +
> +    public void testQuote() throws Exception {
> +        assertEquals("abc", MimeUtility.quote("abc", "&*%"));
> +        assertEquals("\"abc&\"", MimeUtility.quote("abc&", "&*%"));
> +        assertEquals("\"abc\\\"\"", MimeUtility.quote("abc\"", "&* 
> %"));
> +        assertEquals("\"abc\\\\\"", MimeUtility.quote("abc\\", "&* 
> %"));
> +        assertEquals("\"abc\\\r\"", MimeUtility.quote("abc\r", "&* 
> %"));
> +        assertEquals("\"abc\\\n\"", MimeUtility.quote("abc\n", "&* 
> %"));
> +    }
>  }
>
>


Re: svn commit: r412426 - in /geronimo/specs/trunk/geronimo-spec-javamail/src: main/java/javax/mail/internet/ main/java/org/apache/geronimo/mail/util/ test/java/javax/mail/internet/

Posted by Guillaume Nodet <gu...@worldonline.fr>.
I guess it should be 1.1.1-SNAPSHOT then ;)

Cheers,
Guillaume Nodet

Rick McGuire wrote:

> Matt Hogstrom wrote:
>
>> for a SPEC change (unless there was a bug) it makes more sense for a 
>> full point release change and not a dot release.  Dot releases should 
>> be limited to bug, stability and performance related improvements.
>
> Which is why I chose to go with 1.1.1.  The changes I just checked in 
> are merely bug fixes (and some unit test improvements).
>
> Rick
>
>>
>> Rick McGuire wrote:
>>
>>> Alan D. Cabrera wrote:
>>>
>>>> Rick McGuire wrote:
>>>>
>>>>> Kevan Miller wrote:
>>>>>
>>>>>> Rick,
>>>>>> If you're updating javamail, you need to update the version 
>>>>>> number for the javamail spec.
>>>>>> --kevan
>>>>>
>>>>> I was sort of wondering if anything needed to be done there.  I 
>>>>> assume it should be changed from 1.1 to 1.1.1?
>>>>
>>>>
>>>> 1.2-SNAPSHOT please.
>>>
>>> I don't have a problem with changing it to 1.2-SNAPSHOT, but I'd 
>>> like to understand the rationale behind the choice in case it comes 
>>> up in the future.
>>>
>>> Rick
>>>
>>>>
>>>>
>>>> Regards,
>>>> Alan
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>
>
>

Re: svn commit: r412426 - in /geronimo/specs/trunk/geronimo-spec-javamail/src: main/java/javax/mail/internet/ main/java/org/apache/geronimo/mail/util/ test/java/javax/mail/internet/

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
Rick McGuire wrote:
> Alan D. Cabrera wrote:
>> Rick McGuire wrote:
>>> Matt Hogstrom wrote:
>>>> for a SPEC change (unless there was a bug) it makes more sense for 
>>>> a full point release change and not a dot release.  Dot releases 
>>>> should be limited to bug, stability and performance related 
>>>> improvements.
>>> Which is why I chose to go with 1.1.1.  The changes I just checked 
>>> in are merely bug fixes (and some unit test improvements).
>>
>> This should also mirror the repo organization.  Technically, the 
>> 1.0.1 versions that came from trunk should have been labeled 1.1.0.
>>
>> If you intend to release a patch, you should branch the 1_2 tag and 
>> put your patches in there.  Since this is trunk, it should be labled 
>> 1.20-SNAPSHOT.
> Ok, I'll change it to 1.2.  All of the 1.0.1 versions in the repo 
> certainly pushed me to the conclusion that 1.1.1 was the correct way 
> to go.
That's understandable.  It set a bad precedent.


Regards,
Alan



Re: svn commit: r412426 - in /geronimo/specs/trunk/geronimo-spec-javamail/src: main/java/javax/mail/internet/ main/java/org/apache/geronimo/mail/util/ test/java/javax/mail/internet/

Posted by Rick McGuire <ri...@gmail.com>.
Alan D. Cabrera wrote:
> Rick McGuire wrote:
>> Matt Hogstrom wrote:
>>> for a SPEC change (unless there was a bug) it makes more sense for a 
>>> full point release change and not a dot release.  Dot releases 
>>> should be limited to bug, stability and performance related 
>>> improvements.
>> Which is why I chose to go with 1.1.1.  The changes I just checked in 
>> are merely bug fixes (and some unit test improvements).
>
> This should also mirror the repo organization.  Technically, the 1.0.1 
> versions that came from trunk should have been labeled 1.1.0.
>
> If you intend to release a patch, you should branch the 1_2 tag and 
> put your patches in there.  Since this is trunk, it should be labled 
> 1.20-SNAPSHOT.
Ok, I'll change it to 1.2.  All of the 1.0.1 versions in the repo 
certainly pushed me to the conclusion that 1.1.1 was the correct way to go.

Rick

>
>
> Regards,
> Alan
>
>
>


Re: svn commit: r412426 - in /geronimo/specs/trunk/geronimo-spec-javamail/src: main/java/javax/mail/internet/ main/java/org/apache/geronimo/mail/util/ test/java/javax/mail/internet/

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
Rick McGuire wrote:
> Matt Hogstrom wrote:
>> for a SPEC change (unless there was a bug) it makes more sense for a 
>> full point release change and not a dot release.  Dot releases should 
>> be limited to bug, stability and performance related improvements.
> Which is why I chose to go with 1.1.1.  The changes I just checked in 
> are merely bug fixes (and some unit test improvements).

This should also mirror the repo organization.  Technically, the 1.0.1 
versions that came from trunk should have been labeled 1.1.0.

If you intend to release a patch, you should branch the 1_2 tag and put 
your patches in there.  Since this is trunk, it should be labled 
1.20-SNAPSHOT.


Regards,
Alan



Re: svn commit: r412426 - in /geronimo/specs/trunk/geronimo-spec-javamail/src: main/java/javax/mail/internet/ main/java/org/apache/geronimo/mail/util/ test/java/javax/mail/internet/

Posted by Rick McGuire <ri...@gmail.com>.
Matt Hogstrom wrote:
> for a SPEC change (unless there was a bug) it makes more sense for a 
> full point release change and not a dot release.  Dot releases should 
> be limited to bug, stability and performance related improvements.
Which is why I chose to go with 1.1.1.  The changes I just checked in 
are merely bug fixes (and some unit test improvements).

Rick

>
> Rick McGuire wrote:
>> Alan D. Cabrera wrote:
>>> Rick McGuire wrote:
>>>> Kevan Miller wrote:
>>>>> Rick,
>>>>> If you're updating javamail, you need to update the version number 
>>>>> for the javamail spec.
>>>>> --kevan
>>>> I was sort of wondering if anything needed to be done there.  I 
>>>> assume it should be changed from 1.1 to 1.1.1?
>>>
>>> 1.2-SNAPSHOT please.
>> I don't have a problem with changing it to 1.2-SNAPSHOT, but I'd like 
>> to understand the rationale behind the choice in case it comes up in 
>> the future.
>>
>> Rick
>>
>>>
>>>
>>> Regards,
>>> Alan
>>>
>>>
>>>
>>
>>
>>
>>
>


Re: svn commit: r412426 - in /geronimo/specs/trunk/geronimo-spec-javamail/src: main/java/javax/mail/internet/ main/java/org/apache/geronimo/mail/util/ test/java/javax/mail/internet/

Posted by Matt Hogstrom <ma...@hogstrom.org>.
for a SPEC change (unless there was a bug) it makes more sense for a full point release change and 
not a dot release.  Dot releases should be limited to bug, stability and performance related 
improvements.

Rick McGuire wrote:
> Alan D. Cabrera wrote:
>> Rick McGuire wrote:
>>> Kevan Miller wrote:
>>>> Rick,
>>>> If you're updating javamail, you need to update the version number 
>>>> for the javamail spec.
>>>> --kevan
>>> I was sort of wondering if anything needed to be done there.  I 
>>> assume it should be changed from 1.1 to 1.1.1?
>>
>> 1.2-SNAPSHOT please.
> I don't have a problem with changing it to 1.2-SNAPSHOT, but I'd like to 
> understand the rationale behind the choice in case it comes up in the 
> future.
> 
> Rick
> 
>>
>>
>> Regards,
>> Alan
>>
>>
>>
> 
> 
> 
> 

Re: svn commit: r412426 - in /geronimo/specs/trunk/geronimo-spec-javamail/src: main/java/javax/mail/internet/ main/java/org/apache/geronimo/mail/util/ test/java/javax/mail/internet/

Posted by Rick McGuire <ri...@gmail.com>.
Alan D. Cabrera wrote:
> Rick McGuire wrote:
>> Kevan Miller wrote:
>>> Rick,
>>> If you're updating javamail, you need to update the version number 
>>> for the javamail spec.
>>> --kevan
>> I was sort of wondering if anything needed to be done there.  I 
>> assume it should be changed from 1.1 to 1.1.1?
>
> 1.2-SNAPSHOT please.
I don't have a problem with changing it to 1.2-SNAPSHOT, but I'd like to 
understand the rationale behind the choice in case it comes up in the 
future.

Rick

>
>
> Regards,
> Alan
>
>
>


Re: svn commit: r412426 - in /geronimo/specs/trunk/geronimo-spec-javamail/src: main/java/javax/mail/internet/ main/java/org/apache/geronimo/mail/util/ test/java/javax/mail/internet/

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
Rick McGuire wrote:
> Kevan Miller wrote:
>> Rick,
>> If you're updating javamail, you need to update the version number 
>> for the javamail spec.
>> --kevan
> I was sort of wondering if anything needed to be done there.  I assume 
> it should be changed from 1.1 to 1.1.1?

1.2-SNAPSHOT please.


Regards,
Alan



Re: svn commit: r412426 - in /geronimo/specs/trunk/geronimo-spec-javamail/src: main/java/javax/mail/internet/ main/java/org/apache/geronimo/mail/util/ test/java/javax/mail/internet/

Posted by Rick McGuire <ri...@gmail.com>.
Kevan Miller wrote:
> Rick,
> If you're updating javamail, you need to update the version number for 
> the javamail spec.
> --kevan
I was sort of wondering if anything needed to be done there.  I assume 
it should be changed from 1.1 to 1.1.1?

Rick

> On Jun 7, 2006, at 11:21 AM, rickmcguire@apache.org wrote:
>
>> Author: rickmcguire
>> Date: Wed Jun  7 08:21:46 2006
>> New Revision: 412426
>>
>> URL: http://svn.apache.org/viewvc?rev=412426&view=rev
>> Log:
>> GERONIMO-2087 MimeUtility.encodeWord()/encodeText() have some errors.
>>
>>
>> Modified:
>>     
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/javax/mail/internet/MimeUtility.java 
>>
>>     
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/apache/geronimo/mail/util/Base64Encoder.java 
>>
>>     
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/apache/geronimo/mail/util/RFC2231Encoder.java 
>>
>>     
>> geronimo/specs/trunk/geronimo-spec-javamail/src/test/java/javax/mail/internet/MimeUtilityTest.java 
>>
>>
>> Modified: 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/javax/mail/internet/MimeUtility.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/javax/mail/internet/MimeUtility.java?rev=412426&r1=412425&r2=412426&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/javax/mail/internet/MimeUtility.java 
>> (original)
>> +++ 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/javax/mail/internet/MimeUtility.java 
>> Wed Jun  7 08:21:46 2006
>> @@ -554,7 +554,7 @@
>>              if (encoding.equalsIgnoreCase("B")) {
>>                  encoder = "base64";
>>              }
>> -            else if (encoding.equalsIgnoreCase("G")) {
>> +            else if (encoding.equalsIgnoreCase("Q")) {
>>                  encoder = "quoted-printable";
>>              }
>>              else {
>>
>> Modified: 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/apache/geronimo/mail/util/Base64Encoder.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/apache/geronimo/mail/util/Base64Encoder.java?rev=412426&r1=412425&r2=412426&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/apache/geronimo/mail/util/Base64Encoder.java 
>> (original)
>> +++ 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/apache/geronimo/mail/util/Base64Encoder.java 
>> Wed Jun  7 08:21:46 2006
>> @@ -515,21 +515,22 @@
>>              int readCount = in.read(inBuffer);
>>              // did we get a full triplet?  that's an easy encoding.
>>              if (readCount == 3) {
>> -                byte a1 = (byte)(inBuffer[0] & 0xff);
>> -                byte a2 = (byte)(inBuffer[1] & 0xff);
>> -                byte a3 = (byte)(inBuffer[2] & 0xff);
>> +                int  a1 = inBuffer[0] & 0xff;
>> +                int  a2 = inBuffer[1] & 0xff;
>> +                int  a3 = inBuffer[2] & 0xff;
>>
>>                  out.append((char)encodingTable[(a1 >>> 2) & 0x3f]);
>>                  out.append((char)encodingTable[((a1 << 4) | (a2 >>> 
>> 4)) & 0x3f]);
>>                  out.append((char)encodingTable[((a2 << 2) | (a3 >>> 
>> 6)) & 0x3f]);
>>                  out.append((char)encodingTable[a3 & 0x3f]);
>> +
>>              }
>>              else if (readCount <= 0) {
>>                  // eof condition, don'e entirely.
>>                  return;
>>              }
>>              else if (readCount == 1) {
>> -                byte a1 = (byte)(inBuffer[0] & 0xff);
>> +                int  a1 = inBuffer[0] & 0xff;
>>                  out.append((char)encodingTable[(a1 >>> 2) & 0x3f]);
>>                  out.append((char)encodingTable[(a1 << 4) & 0x3f]);
>>                  out.append((char)padding);
>> @@ -537,8 +538,8 @@
>>                  return;
>>              }
>>              else if (readCount == 2) {
>> -                byte a1 = (byte)(inBuffer[0] & 0xff);
>> -                byte a2 = (byte)(inBuffer[1] & 0xff);
>> +                int  a1 = inBuffer[0] & 0xff;
>> +                int  a2 = inBuffer[1] & 0xff;
>>
>>                  out.append((char)encodingTable[(a1 >>> 2) & 0x3f]);
>>                  out.append((char)encodingTable[((a1 << 4) | (a2 >>> 
>> 4)) & 0x3f]);
>>
>> Modified: 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/apache/geronimo/mail/util/RFC2231Encoder.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/apache/geronimo/mail/util/RFC2231Encoder.java?rev=412426&r1=412425&r2=412426&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/apache/geronimo/mail/util/RFC2231Encoder.java 
>> (original)
>> +++ 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/main/java/org/apache/geronimo/mail/util/RFC2231Encoder.java 
>> Wed Jun  7 08:21:46 2006
>> @@ -52,7 +52,7 @@
>>              (byte)'8', (byte)'9', (byte)'A', (byte)'B', (byte)'C', 
>> (byte)'D', (byte)'E', (byte)'F'
>>          };
>>
>> -    protected String DEFAULT_SPECIALS = " *\\%";
>> +    protected String DEFAULT_SPECIALS = " *'%";
>>      protected String specials = DEFAULT_SPECIALS;
>>
>>      /*
>> @@ -92,11 +92,11 @@
>>          int bytesWritten = 0;
>>          for (int i = off; i < (off + length); i++)
>>          {
>> -            byte ch = data[i];
>> +            int ch = data[i] & 0xff;
>>              // character tha must be encoded?  Prefix with a '%' and 
>> encode in hex.
>>              if (ch <= 32 || ch >= 127 || specials.indexOf(ch) != -1) {
>>                  out.write((byte)'%');
>> -                out.write(encodingTable[(ch >> 4)]);
>> +                out.write(encodingTable[ch >> 4]);
>>                  out.write(encodingTable[ch & 0xf]);
>>                  bytesWritten += 3;
>>              }
>>
>> Modified: 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/test/java/javax/mail/internet/MimeUtilityTest.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail/src/test/java/javax/mail/internet/MimeUtilityTest.java?rev=412426&r1=412425&r2=412426&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/test/java/javax/mail/internet/MimeUtilityTest.java 
>> (original)
>> +++ 
>> geronimo/specs/trunk/geronimo-spec-javamail/src/test/java/javax/mail/internet/MimeUtilityTest.java 
>> Wed Jun  7 08:21:46 2006
>> @@ -83,4 +83,43 @@
>>          }
>>      }
>>
>> +
>> +    public void testEncodeWord() throws Exception {
>> +        assertEquals("abc", MimeUtility.encodeWord("abc"));
>> +        // default code page dependent, hard to directly test the 
>> encoded results
>> +        assertEquals(" hé! àèôu !!!", 
>> MimeUtility.decodeWord(MimeUtility.encodeWord(" hé! àèôu !!!")));
>> +
>> +        String encoded = MimeUtility.encodeWord(" hé! àèôu !!!", 
>> "UTF-8", "Q");
>> +        
>> assertEquals("=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?=", encoded);
>> +        assertEquals(" hé! àèôu !!!", MimeUtility.decodeWord(encoded));
>> +
>> +        encoded = MimeUtility.encodeWord(" hé! àèôu !!!", "UTF-8", 
>> "B");
>> +        assertEquals("=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=", encoded);
>> +        assertEquals(" hé! àèôu !!!", MimeUtility.decodeWord(encoded));
>> +    }
>> +
>> +
>> +    public void testEncodeText() throws Exception {
>> +        assertEquals("abc", MimeUtility.encodeWord("abc"));
>> +        // default code page dependent, hard to directly test the 
>> encoded results
>> +        assertEquals(" hé! àèôu !!!", 
>> MimeUtility.decodeText(MimeUtility.encodeText(" hé! àèôu !!!")));
>> +
>> +        String encoded = MimeUtility.encodeText(" hé! àèôu !!!", 
>> "UTF-8", "Q");
>> +        
>> assertEquals("=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?=", encoded);
>> +        assertEquals(" hé! àèôu !!!", MimeUtility.decodeText(encoded));
>> +
>> +        encoded = MimeUtility.encodeText(" hé! àèôu !!!", "UTF-8", 
>> "B");
>> +        assertEquals("=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=", encoded);
>> +        assertEquals(" hé! àèôu !!!", MimeUtility.decodeText(encoded));
>> +    }
>> +
>> +
>> +    public void testQuote() throws Exception {
>> +        assertEquals("abc", MimeUtility.quote("abc", "&*%"));
>> +        assertEquals("\"abc&\"", MimeUtility.quote("abc&", "&*%"));
>> +        assertEquals("\"abc\\\"\"", MimeUtility.quote("abc\"", "&*%"));
>> +        assertEquals("\"abc\\\\\"", MimeUtility.quote("abc\\", "&*%"));
>> +        assertEquals("\"abc\\\r\"", MimeUtility.quote("abc\r", "&*%"));
>> +        assertEquals("\"abc\\\n\"", MimeUtility.quote("abc\n", "&*%"));
>> +    }
>>  }
>>
>>
>
>