URLConnection.guessContentTypeFromStream() does not support UTF8 and UTF32 with BOM

Charles Lee littlee at linux.vnet.ibm.com
Sun Mar 13 18:27:28 PDT 2011


On 03/11/2011 07:14 PM, Chris Hegarty wrote:
> On 11/03/2011 05:13, Charles Lee wrote:
>> On 03/10/2011 11:46 PM, Chris Hegarty wrote:
>>> Charles, Alan,
>>>
>>> I filed CR 7026346: " URLConnection.guessContentTypeFromStream does
>>> not support UTF-8 and UTF-32 xml streams with BOM", for this issue.
>>>
>>> I also creating a webrev from your patch, with the following changes:
>>>
>>> * Moved the UTF-32BE before the UTF-32LE, as per the comment
>>> * filled out the UTF-32BE and UTF-32LE around the '?' '<' 'x' chars
>>> * Included you original test in an existing test for xml content types.
>>>
>>> Charles, Please verify the changes.
>>>
>>> http://cr.openjdk.java.net/~chegar/7026346/webrev.00/webrev/
>>>
>>> Alan,
>>> I believe you already looked at the original patch. I think these
>>> changes are fine, can you please also review.
>>>
>>> Thanks,
>>> -Chris.
>> Looks even better. Thanks a lot Chris.
>
> JDK7 changeset [1]:
>
> Changeset: 107d55ecd50d
> Author:    chegar
> Date:      2011-03-11 08:57 +0000
> URL:       http://hg.openjdk.java.net/jdk7/tl/jdk/rev/107d55ecd50d
>
> 7026346: URLConnection.guessContentTypeFromStream does not support 
> UTF-8 and UTF-32 xml streams with BOM
> Reviewed-by: alanb
> Contributed-by: Charles Lee <littlee at linux.vnet.ibm.com>
>
> ! src/share/classes/java/net/URLConnection.java
> ! test/java/net/URLConnection/GetXmlContentType.java
>
> -Chris.
>
> [1]  
> http://mail.openjdk.java.net/pipermail/net-dev/2011-March/002869.html
Great. Thanks Chris.



More information about the net-dev mailing list