]> granicus.if.org Git - icu/commitdiff
ICU-8569 Terminate the UTF-7 byte buffer with MINUS when flushing
authorMichael Ow <mow@svn.icu-project.org>
Wed, 1 Jun 2011 16:26:45 +0000 (16:26 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Wed, 1 Jun 2011 16:26:45 +0000 (16:26 +0000)
X-SVN-Rev: 30176

icu4j/main/classes/charset/src/com/ibm/icu/charset/CharsetUTF7.java
icu4j/main/shared/data/testdata.jar
icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestCharset.java

index 65e48dd7bd9204f5160002be6c96cd554d2ed469..2a5b4a568bb74e2a5a9c867eddf1c3aa424dd60b 100644 (file)
@@ -738,17 +738,16 @@ class CharsetUTF7 extends CharsetICU {
                             cr=CoderResult.OVERFLOW;
                         }
                     }
-                    if (useIMAP) {
-                        /* IMAP: need to terminate with a minus */
-                        if (target.hasRemaining()) {
-                            target.put(MINUS);
-                            if (offsets!=null) {
-                                offsets.put(sourceIndex - 1);
-                            }
-                        } else {
-                            errorBuffer[errorBufferLength++]=MINUS;
-                            cr=CoderResult.OVERFLOW;
+                    
+                    /* need to terminate with a minus */
+                    if (target.hasRemaining()) {
+                        target.put(MINUS);
+                        if (offsets!=null) {
+                            offsets.put(sourceIndex - 1);
                         }
+                    } else {
+                        errorBuffer[errorBufferLength++]=MINUS;
+                        cr=CoderResult.OVERFLOW;
                     }
                 }
                 /*reset the state for the next conversion */
index 7668ee9152d197c53c64f78c0a40f0eca72ac870..17f34dfe3022aabf004aad23d3365dc360d6bc96 100755 (executable)
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:e3758a1b8ac244b1f79cb0e6a6e0e8e096cc731e7be04e7574f44661c68f3751
-size 718981
+oid sha256:05b495174797742c80b3deda49ce5730e57f6ac46a0cac19b9f60257e96f1b62
+size 719054
index 79b32df452de90de1482f8c8d9c6a449fbb8b1f8..6bbef736610ca8930d2df864a9412d1db7e63c71 100644 (file)
@@ -3160,7 +3160,7 @@ public class TestCharset extends TestFmwk {
         
         //test for overflow buffer error
         ccus.put((char)0x2262);
-        ccbs.put((byte)0x2b); ccbs.put((byte)0x49); ccbs.put((byte)0x6d); ccbs.put((byte)0x49);
+        ccbs.put((byte)0x2b); ccbs.put((byte)0x49); ccbs.put((byte)0x6d); ccbs.put((byte)0x49); ccbs.put((byte)0x2d);
         
         ccbs.limit(ccbs.position());
         ccbs.position(0);
@@ -3178,7 +3178,7 @@ public class TestCharset extends TestFmwk {
         //test for overflow buffer error
         encoder.reset();
         ccus.put((char)0x3980); ccus.put((char)0x2715);
-        ccbs.put((byte)0x2b); ccbs.put((byte)0x4f); ccbs.put((byte)0x59);
+        ccbs.put((byte)0x2b); ccbs.put((byte)0x4f); ccbs.put((byte)0x59); ccbs.put((byte)0x2d);
         
         ccbs.limit(ccbs.position());
         ccbs.position(0);