code: private static String fixEncodedURI(final String encodedUri) {
          if (encodedUri == null) {
              return null;
          }
          final StringBuilder sb = new StringBuilder();
          int lastPercIdx = -3; // we will check position-2
          for (int i = 0, n = encodedUri.length(); i < n; i++) {
              char c = encodedUri.charAt(i);
              if (c == '%') {
                  lastPercIdx = i;
              } else if (lastPercIdx >= i - 2 && c >= 'A' && c <= 'F') {
                  c = (char) (c - 'A' + 'a');
              }
              sb.append(c);
          }
          return sb.toString();
      }
docs: Gets {@link URI#toASCIIString()} as an input and the escaped octets %XX are converted to lower case (because of the
  Oracle PolicyFile implementation of CodeSource comparing).
  
  @param encodedUri
  @return given URI String with lower-cased codes of non-ascii characters