question: static int firstIllegalCharacter ( String source ) { for ( int i = 0 ; i < source . length ( ) ; i ++ ) { if ( isLegal ( source . charAt ( i ) ) == false ) { return i ; } } return - 1 ; }
target:  Utility method to find the first invalid character as per RFC 2396 section 2. This helps us prevent creating excessive objects in the encode() methods since most strings will not be encoded.