@Test
public void testBasicAuthenticationWith88591Chars() throws Exception {

    int[] germanChars = { 0xE4, 0x2D, 0xF6, 0x2D, 0xFc };
    StringBuilder buffer = new StringBuilder();
    for (int i = 0; i < germanChars.length; i++) {
        buffer.append((char)germanChars[i]);
    }
    UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("dh", buffer.toString());
    Header header = BasicScheme.authenticate(credentials, "ISO-8859-1", false);
    Assert.assertEquals("Basic ZGg65C32Lfw=", header.getValue());
}