commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Closed: (CODEC-20) [codec] URLCodec.decode() corrupts characters > 127 in unencoded strings
Date Sat, 08 Mar 2008 07:29:46 GMT

     [ https://issues.apache.org/jira/browse/CODEC-20?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Henri Yandell closed CODEC-20.
------------------------------

    Resolution: Won't Fix

> [codec] URLCodec.decode() corrupts characters > 127 in unencoded strings
> ------------------------------------------------------------------------
>
>                 Key: CODEC-20
>                 URL: https://issues.apache.org/jira/browse/CODEC-20
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects 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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message