mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-4060 Fix bug that caused partial escape sequence matches to count as a full match.
X-SVN-Rev: 17793
This commit is contained in:
parent
961ac9ab51
commit
113b29ecc4
1 changed files with 7 additions and 3 deletions
|
@ -43,17 +43,21 @@ abstract class CharsetRecog_2022 extends CharsetRecognizer {
|
|||
checkEscapes:
|
||||
for (escN=0; escN<escapeSequences.length; escN++) {
|
||||
byte [] seq = escapeSequences[escN];
|
||||
|
||||
for (j=1; j<seq.length; j++) {
|
||||
if (seq[j] != text[i+j]) {
|
||||
continue checkEscapes;
|
||||
}
|
||||
hits++;
|
||||
i += seq.length-1;
|
||||
continue scanInput;
|
||||
}
|
||||
|
||||
hits++;
|
||||
i += seq.length-1;
|
||||
continue scanInput;
|
||||
}
|
||||
|
||||
misses++;
|
||||
}
|
||||
|
||||
if (text[i] == 0x0e || text[i] == 0x0f) {
|
||||
// Shift in/out
|
||||
shifts++;
|
||||
|
|
Loading…
Add table
Reference in a new issue