public static String backslashEncode ( String s ) { StringBuilder buf = new StringBuilder ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { int c = buf . charAt ( i ) ; if ( _MustBackslashEscape . indexOf ( c ) >= 0 ) buf . append ( _BACKSLASHEscape ) ; buf . append ( ( char ) c ) ; } return buf . toString ( ) ; }
Define the DEFINITIVE URL BACKSLASH escape function .