# HG changeset patch # User andrew # Date 1344259225 -3600 # Node ID 592827b0fb735f3255f5740984bcea7470ac9731 # Parent fc3d8d956b087e80667be13da81b2f0521bd46a5# Parent 0a313d4307930be3a64106b9b8c90f9342673aa0 Merge jdk7u8-b01 diff -r fc3d8d956b08 -r 592827b0fb73 .hgtags --- a/.hgtags Wed Jul 25 18:24:05 2012 +0100 +++ b/.hgtags Mon Aug 06 14:20:25 2012 +0100 @@ -201,3 +201,4 @@ 1c4b9671de5c7ed5713f55509cb2ada38b36dffe jdk7u6-b18 3ba4c395d2cf973c8c603b2aedc846bd4ae54656 jdk7u6-b19 4f7b77cc3b252098f52a8f30a74f603783a2e0f1 jdk7u6-b20 +1365e7472a3b737dda4a73e06ad41718d667d9be jdk7u8-b01 diff -r fc3d8d956b08 -r 592827b0fb73 src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java --- a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java Wed Jul 25 18:24:05 2012 +0100 +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java Mon Aug 06 14:20:25 2012 +0100 @@ -602,7 +602,7 @@ if (reader == null) { stream = xmlInputSource.getByteStream(); if (stream == null) { - URL location = new URL(escapeNonUSAscii(expandedSystemId)); + URL location = new URL(expandedSystemId); URLConnection connect = location.openConnection(); if (!(connect instanceof HttpURLConnection)) { stream = connect.getInputStream(); @@ -2586,64 +2586,6 @@ } // fixURI(String):String - /** - * Escape invalid URI characters. - * - * Passed a URI that contains invalid characters (like spaces, non-ASCII Unicode characters, and the like), - * this function percent encodes the invalid characters per the URI specification (i.e., as a sequence of - * %-encoded UTF-8 octets). - * - * N.B. There are two problems. If the URI contains a '%' character, that might be an indication that - * the URI has already been escaped by the author, or it might be an invalid '%'. In the former case, - * it's important not to escape it, or we'll wind up with invalid, doubly-escaped '%'s. In the latter, - * the URI is broken if we don't encode it. Similarly, a '#' character might be the start of a fragment - * identifier or it might be an invalid '#'. - * - * Given that the former is vastly more likely than the latter in each case (most users are familiar with - * the magic status of '%' and '#' and they occur relatively infrequently in filenames, and if the user parses - * a proper Java File, we will already have %-escaped the URI), we simply assume that %'s and #'s are legit. - * - * Very rarely, we may be wrong. If so, tell the user to fix the clearly broken URI. - */ - protected static String escapeNonUSAscii(String str) { - if (str == null) { - return str; - } - - // get UTF-8 bytes for the string - StringBuffer buffer = new StringBuffer(); - byte[] bytes = null; - byte b; - try { - bytes = str.getBytes("UTF-8"); - } catch (java.io.UnsupportedEncodingException e) { - // should never happen - return str; - } - int len = bytes.length; - int ch; - - // for each byte - for (int i = 0; i < len; i++) { - b = bytes[i]; - // for non-ascii character: make it positive, then escape - if (b < 0) { - ch = b + 256; - buffer.append('%'); - buffer.append(gHexChs[ch >> 4]); - buffer.append(gHexChs[ch & 0xf]); - } - else if (b != '%' && b != '#' && gNeedEscaping[b]) { - buffer.append('%'); - buffer.append(gAfterEscaping1[b]); - buffer.append(gAfterEscaping2[b]); - } - else { - buffer.append((char)b); - } - } - return buffer.toString(); - } // // Package visible methods