xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jelka.ko...@atol.si
Subject Bug report - URIResolver and basic authentication working incorrect when EBCDIC codepage is used
Date Thu, 10 May 2007 14:20:04 GMT
Similar to my previous mail I have a problem retrieving images from a 
database that uses basic authentication.

Looking at the code I think the problem is again in the EBCDIC codepage 
that is used on the server.

The problem is bolded:

protected void applyHttpBasicAuthentication(URLConnection connection, 
            String username, String password) {
        String combined = username + ":" + password;
        try {
            ByteArrayOutputStream baout = new 
ByteArrayOutputStream(combined.length() * 2);
            Base64EncodeStream base64 = new Base64EncodeStream(baout);
            base64.write(combined.getBytes());
            base64.close();
            connection.setRequestProperty("Authorization", 
                    "Basic " + new String(baout.toByteArray()));
        } catch (IOException e) {
            //won't happen. We're operating in-memory.
            throw new RuntimeException("Error during base64 encodation of 
username/password");
        }
    }

This function is defined in: 
src\java\org\apache\fop\apps\FOURIResolver.java

I will try with base64.write(combined.getBytes("UTF-8"));

Will keep you posted.

Jelka
Mime
View raw message