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 >= 'a' && c <= 'z') {
                output.append(c);
            } else if (c >= 'A' && c <= 'Z') {
                output.append(c);
            } else if (c >= '0' && c <= '9') {
                output.append(c);
            } else if (safeChars.contains(c)) {
                output.append(c);
            } else {
                output.append(HEX[c]);
            }
        }
        return output.toString();
    }
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 >= 'a' && c <= 'z' ) { output . append ( c ) ; } else if ( c >= 'A' && c <= 'Z' ) { output . append ( c ) ; } else if ( c >= '0' && c <= '9' ) { 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.
@param original the origin string to escape
@return the escaped string