summaryrefslogtreecommitdiffstats
path: root/icu/src/main/java
diff options
context:
space:
mode:
authorUrs Grob <ursg@google.com>2009-09-02 16:27:56 +0200
committerUrs Grob <ursg@google.com>2009-09-04 09:27:39 +0200
commit13b99f209404c75a95a9e8cb791d4a4bfad7431c (patch)
tree0ba85813dac9ad8c4bbc002f1ea5652e0e8d8043 /icu/src/main/java
parent051128862ae7c5c031b8ddb763848ed264a63746 (diff)
downloadlibcore-13b99f209404c75a95a9e8cb791d4a4bfad7431c.zip
libcore-13b99f209404c75a95a9e8cb791d4a4bfad7431c.tar.gz
libcore-13b99f209404c75a95a9e8cb791d4a4bfad7431c.tar.bz2
InputStreamReader forgets to convert incomplete multibyte characters at the buffer boundary
BUG=2033986
Diffstat (limited to 'icu/src/main/java')
-rw-r--r--icu/src/main/java/com/ibm/icu4jni/charset/CharsetDecoderICU.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/icu/src/main/java/com/ibm/icu4jni/charset/CharsetDecoderICU.java b/icu/src/main/java/com/ibm/icu4jni/charset/CharsetDecoderICU.java
index 206f0c8..919d865 100644
--- a/icu/src/main/java/com/ibm/icu4jni/charset/CharsetDecoderICU.java
+++ b/icu/src/main/java/com/ibm/icu4jni/charset/CharsetDecoderICU.java
@@ -344,18 +344,11 @@ public final class CharsetDecoderICU extends CharsetDecoder{
// ok was there input held in the previous invocation of decodeLoop
// that resulted in output in this invocation?
- if(data[OUTPUT_OFFSET]>0 && savedInputHeldLen >0){
- int len = in.position() + data[INPUT_OFFSET] + savedInputHeldLen;
- in.position(len);
- savedInputHeldLen = data[INPUT_HELD];
- }else{
- in.position(in.position() + data[INPUT_OFFSET] + savedInputHeldLen);
- savedInputHeldLen = data[INPUT_HELD];
- in.position(in.position() - savedInputHeldLen);
- }
- // BEGIN android-added
+ // BEGIN android-changed
+ in.position(in.position() + data[INPUT_OFFSET] + savedInputHeldLen - data[INPUT_HELD]);
+ savedInputHeldLen = data[INPUT_HELD];
// release reference to input array, which may not be ours
input = null;
- // END android-added
+ // END android-changed
}
}