* SUMMARY When attempting to create a layout test for Bug 22466, I tried moving fast/encoding/preload-encoding.html to an http test. After setting the charset encoding for the "gb2312" files using a .htaccess file, I found that DRT would crash in convertWebResourceDataToString() because dataAsString was nil using the hard-coded UTF-8 encoding: NSString *dataAsString = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; [resource setObject:dataAsString forKey:@"WebResourceData"]; * THE FIX The better way to do this is to: 1. Attempt to convert the IANA charset into an NSStringEncoding value. 2. Check that dataAsString is non-nil before replacing it in the dictionary. Instead of crashing, the worst that will happen is that the string data won't be decoded in the webarchive test output.
Created attachment 25488 [details] Patch v1 Suggested fix. No layout test since this is a DRT fix.
$ git svn dcommit Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebKitTools/ChangeLog M WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm Committed r38786 http://trac.webkit.org/changeset/38786