@Test
    void testDigestAuthenticationWithExtendedAsciiCharInUsername() throws Exception {
        final ClassicHttpRequest request = new BasicClassicHttpRequest("POST", "/");
        final HttpHost host = new HttpHost("somehost", 80);
        // Using an extended ASCII character (e.g., 0x80) in the username
        final CredentialsProvider credentialsProvider = CredentialsProviderBuilder.create()
                .add(new AuthScope(host, "realm1", null), "username\u0080", "password".toCharArray())
                .build();

        final String challenge = StandardAuthScheme.DIGEST + " realm=\"realm1\", nonce=\"f2a3f18799759d4f1a1c068b92b573cb\", qop=\"auth-int\"";
        final AuthChallenge authChallenge = parse(challenge);
        final DigestScheme authscheme = new DigestScheme();
        authscheme.processChallenge(authChallenge, null);

        Assertions.assertTrue(authscheme.isResponseReady(host, credentialsProvider, null));
        final String authResponse = authscheme.generateAuthResponse(host, request, null);


        Assertions.assertTrue(authResponse.contains("username*"));
    }
Test digest authentication with unknown qop value
httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestDigestScheme.java