commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Janek Bogucki <>
Subject [latka] UTF-16 was wrong encoding choice
Date Thu, 19 Sep 2002 12:07:06 GMT

I submitted a patch to o.a.c.latka.http.RequestImpl to stop it using a 
deprecated method in httpclient. My code used UTF-16 as the encoding

InputStream  is = new 
((PostMethod) _httpMethod).setRequestBody(is);

My choice of a two byte encoding is seriously broken because the stream is 
later accessed one byte at a time in o.a.c.httpclient.methods.PostMethod 

        int data =;

        while (data != -1) {
            buffer.append((char) data);
            data =;

In my sandbox I have changed to use ISO-8859-1 but would like some other 
opinions before I post a patch to undo the UTF-16 mistake. Is ISO-8859-1 the 
right choice?

Janek Bogucki

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message