ICU-5768 Fixed the while loop for the BOM detection. Also, fixed the getChar in UTF32BE so that it will give a BE character instead of LE.
X-SVN-Rev: 21914
This commit is contained in:
parent
a0daf6de27
commit
ac1ccad107
@ -53,7 +53,7 @@ class CharsetUTF32 extends CharsetICU {
|
||||
offsetDelta=0;
|
||||
int pos = source.position();
|
||||
if(isFirstBuffer && toULength<SIGNATURE_LENGTH){
|
||||
while(pos < source.limit() && pos < toULength) {
|
||||
while(pos < source.limit() && pos < SIGNATURE_LENGTH) {
|
||||
toUBytesArray[toULength++] = source.get(pos++);
|
||||
}
|
||||
if(toULength==SIGNATURE_LENGTH){
|
||||
|
@ -30,7 +30,7 @@ class CharsetUTF32BE extends CharsetUTF32 {
|
||||
protected int getChar(byte[] bytes, int length){
|
||||
int i=0, ch=0;
|
||||
while (i<length){
|
||||
ch |= (bytes[i] & UConverterConstants.UNSIGNED_BYTE_MASK) << (i * 8);
|
||||
ch |= (bytes[i] & UConverterConstants.UNSIGNED_BYTE_MASK) << ((3-i) * 8);
|
||||
i++;
|
||||
}
|
||||
return ch;
|
||||
|
Loading…
Reference in New Issue
Block a user