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

2011-04-26 Thread Charles Lee
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 befo

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

2011-03-13 Thread Charles Lee
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 creat

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

2011-03-11 Thread Chris Hegarty
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 followi

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

2011-03-10 Thread Alan Bateman
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

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

2011-03-10 Thread Chris Hegarty
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

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

2011-03-07 Thread Charles Lee
On 03/07/2011 09:56 PM, Chris Hegarty wrote: I think Alan mentioned it in an earlier mail, this is a legacy API and not widely used. I can't say I've come across its use more than a handful of times in more than 10 years. If you have a small patch that resolves a particular issue then maybe w

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

2011-03-07 Thread Chris Hegarty
I think Alan mentioned it in an earlier mail, this is a legacy API and not widely used. I can't say I've come across its use more than a handful of times in more than 10 years. If you have a small patch that resolves a particular issue then maybe we should just proceed with getting it in. -C

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

2011-03-06 Thread Charles Lee
On 03/04/2011 07:13 PM, Alan Bateman wrote: Charles Lee wrote: Hi Alan, Sorry for the late reply. This test case comes from a big test case, which test more types of stream. A test for this method should pass if "null" is returned as the method does not specify the content types that it reco

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

2011-03-04 Thread Alan Bateman
Charles Lee wrote: Hi Alan, Sorry for the late reply. This test case comes from a big test case, which test more types of stream. A test for this method should pass if "null" is returned as the method does not specify the content types that it recognizes. I think it's okay to extend it as yo

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

2011-03-03 Thread Charles Lee
On 03/03/2011 12:48 AM, Alan Bateman wrote: Charles Lee wrote: Hi guys, With test case[1] below, you can see guessContent does not support UTF8/32 BOM. I don't see a problem with this proposal but I just wonder if this method is even used these days. It is a legacy method and I don't think

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

2011-03-02 Thread Alan Bateman
Charles Lee wrote: Hi guys, With test case[1] below, you can see guessContent does not support UTF8/32 BOM. I don't see a problem with this proposal but I just wonder if this method is even used these days. It is a legacy method and I don't think anyone can rely on it to reliably detect any

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

2011-03-01 Thread Charles Lee
Hi guys, With test case[1] below, you can see guessContent does not support UTF8/32 BOM. This problem could be solved with the patch[2]. The patch is straight forward: 1. read more bytes since UTF32 2. add xml type support in utf8 and utf32 BOM. [1] test case: public static void main(String[