private static String correctUser ( String user ) { if ( user != null && user . trim ( ) . length ( ) > 0 && ( false || user . indexOf ( ' ' ) == - 1 ) ) { String escaped = escapeSpecialAsciiAndNonAscii ( user ) ; StringBuilder totalEscaped = new StringBuilder ( ) ; for ( int i = 0 ; i < escaped . length ( ) ; i ++ ) { char ch = escaped . charAt ( i ) ; if ( ch == ' ' || ch == ' ' || ch == ' ' ) { totalEscaped . append ( ' ' ) . append ( Integer . toHexString ( ch ) . toUpperCase ( ) ) ; } else { totalEscaped . append ( ch ) ; } } user = totalEscaped . toString ( ) ; } return user ; }
Escape the specified user .