private static Uri UriFromMrl(String mrl){
  final char array[]=mrl.toCharArray();
  final StringBuilder sb=new StringBuilder(array.length);
  for (int i=0; i < array.length; ++i) {
    final char c=array[i];
    if (c == '%') {
      if (array.length - i >= 3) {
        try {
          final int hex=Integer.parseInt(new String(array,i + 1,2),16);
          if (URI_AUTHORIZED_CHARS.indexOf(hex) != -1) {
            sb.append((char)hex);
            i+=2;
            continue;
          }
        }
 catch (        NumberFormatException ignored) {
        }
      }
    }
    sb.append(c);
  }
  return Uri.parse(sb.toString());
}

private static Uri UriFromMrl ( String mrl ) { final char array [ ] = mrl . toCharArray ( ) ; final StringBuilder sb = new StringBuilder ( array . length ) ; for ( int i = 0 ; i < array . length ; ++ i ) { final char c = array [ i ] ; if ( c == '%' ) { if ( array . length - i >= 3 ) { try { final int hex = Integer . parseInt ( new String ( array , i + 1 , 2 ) , 16 ) ; if ( URI_AUTHORIZED_CHARS . indexOf ( hex ) != - 1 ) { sb . append ( ( char ) hex ) ; i += 2 ; continue ; } } catch ( NumberFormatException ignored ) { } } } sb . append ( c ) ; } return Uri . parse ( sb . toString ( ) ) ; }
vlc authorize only " - . _ ~ " in mrl format , android uri authorize " _ - ! . ~ ' ( ) * " . therefore , decode the characters authorized by android uri when creating an uri from vlc .
