Project

Profile

Help

Revision 8de369ca

Added by Michael Kay over 14 years ago

Fix bug 1755986 (StringIndexOutOfBounds in normalize-unicode() (retrofitted patch for Saxon 8.8)

View differences:

latest8.8/bj/net/sf/saxon/codenorm/Normalizer.java
116 116
            for (int j = 0; j < buffer.length();) {
117 117
                //ch = UTF16.charAt(buffer, j);
118 118
                ch = buffer.charAt(j++);
119
                if (XMLChar.isHighSurrogate(ch32)) {
119
                if (XMLChar.isHighSurrogate(ch)) {
120 120
                    char low = buffer.charAt(j++);
121 121
                    ch = XMLChar.supplemental((char)ch, low);
122 122
                }
......
131 131
                        ch2 = target.charAt(k-1);
132 132
                        if (XMLChar.isSurrogate(ch2)) {
133 133
                            k--;
134
                            char high = buffer.charAt(k-1);
134
                            char high = target.charAt(k-1);
135 135
                            ch2 = XMLChar.supplemental(high, (char)ch2);
136 136
                        }
137 137
                        if (data.getCanonicalClass(ch2) <= chClass) break;

Also available in: Unified diff