Project

Profile

Help

Revision 6d46fe70

Added by Michael Kay over 14 years ago

Fix bug 1755986 - StringIndexOutOfBounds in normalize-unicode()

View differences:

latest8.9/bj/net/sf/saxon/codenorm/Normalizer.java
148 148
            for (int j = 0; j < buffer.length();) {
149 149
                //ch = UTF16.charAt(buffer, j);
150 150
                ch = buffer.charAt(j++);
151
                if (XMLChar.isHighSurrogate(ch32)) {
151
                if (XMLChar.isHighSurrogate(ch)) {
152 152
                    char low = buffer.charAt(j++);
153 153
                    ch = XMLChar.supplemental((char)ch, low);
154 154
                }
......
163 163
                        ch2 = target.charAt(k-1);
164 164
                        if (XMLChar.isSurrogate(ch2)) {
165 165
                            k--;
166
                            char high = buffer.charAt(k-1);
166
                            char high = target.charAt(k-1);
167 167
                            ch2 = XMLChar.supplemental(high, (char)ch2);
168 168
                        }
169 169
                        if (data.getCanonicalClass(ch2) <= chClass) break;

Also available in: Unified diff