private void validatePassword() throws AuthenticationException {
        if (credentials == null) {
            throw new AuthenticationException("User credentials not set");
        }
        final char[] password = credentials.getUserPassword();
        if (password != null) {
            for (final char ch : password) {
                if (Character.isISOControl(ch)) {
                    throw new AuthenticationException("Password must not contain any control characters");
                }
            }
        }
    }
Constructs a new BasicScheme with UTF-8 as the charset.

@since 4.3
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicScheme.java