commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31161] - URLCodec.decode() corrupts characters > 127 in unencoded strings
Date Fri, 10 Sep 2004 15:44:08 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31161>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31161

URLCodec.decode() corrupts characters > 127 in unencoded strings





------- Additional Comments From olegk@apache.org  2004-09-10 15:44 -------
Hannes,

The perceived data corruption is caused by the String to byte[] conversion, not
by the codec itself

return new String(
  decode(pString.getBytes(CharacterEncodingNames.US_ASCII)), 
  charset);
 
Feel free to provide your own convenience method on top of byte[] to byte[]
version of the decode method

return new String(
  decode(pString.getBytes("ISO-8859-1")), 
  charset);

I'll provide a test case showing that the codec is at fault here

Oleg

---------------------------------------------------------------------
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