commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CODEC-20) [codec] URLCodec.decode() corrupts characters > 127 in unencoded strings
Date Fri, 14 Jul 2006 05:29:30 GMT
     [ http://issues.apache.org/jira/browse/CODEC-20?page=all ]

Henri Yandell updated CODEC-20:
-------------------------------

    Bugzilla Id:   (was: 31161)
    Fix Version: 1.4

Looks like this issue is probably ready for closing with the result being the added unit test
to show that Codec can't do much here.

> [codec] URLCodec.decode() corrupts characters > 127 in unencoded strings
> ------------------------------------------------------------------------
>
>          Key: CODEC-20
>          URL: http://issues.apache.org/jira/browse/CODEC-20
>      Project: Commons Codec
>         Type: Bug

>     Versions: 1.3
>  Environment: Operating System: Linux
> Platform: PC
>     Reporter: Hannes Wallnoefer
>      Fix For: 1.4
>  Attachments: codec.patch
>
> If URLCodec.decode() is called with a String that contains unencoded characters
> in the 128-255 range, these characters are corrupted. The reason for this is in
> the way characters that don't need decoding are passed from the source to the
> target string:
>             int b = bytes[i];
>             
>             (...)
>      
>             buffer.write(b);
> If a character code is > 127, it results in integer b being in the -128..-1
> range, and when it's lowest byte is written to the buffer it's something else
> than the original one. 
> I think the fix would be to add 256 to b if b is less than zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message