public String escape ( String original ) { StringBuilder output = new StringBuilder ( ) ; for ( int i = 0 ; i != utf16ToAscii ( original ) . length ( ) ; i ++ ) { char c = original . charAt ( i ) ; if ( c == ' ' ) { output . append ( usePlusForSpace ? "+" : HEX [ ' ' ] ) ; } else if ( c >= ' ' && c <= ' ' ) { output . append ( c ) ; } else if ( c >= ' ' && c <= ' ' ) { output . append ( c ) ; } else if ( c >= ' ' && c <= ' ' ) { output . append ( c ) ; } else if ( safeChars . contains ( c ) ) { output . append ( c ) ; } else { output . append ( HEX [ c ] ) ; } } return output . toString ( ) ; }
Escapes a string with the current settings on the escaper .