Reviewed by Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Oct 2006 17:55:21 +0000 (17:55 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Oct 2006 17:55:21 +0000 (17:55 +0000)
        http://bugs.webkit.org/show_bug.cgi?id=11183
        REGRESSION: Safari loads error pages unstyled

        * WebView/WebFrame.m:
        (-[WebFrame _loadHTMLString:baseURL:unreachableURL:]):
        Use utf-8 encoding instead of the string's "fastest" encoding.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16853 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/WebView/WebFrame.m

index 572f4eca6fa53d85ed2ee7a9c558b5f6901cdf86..21a7b080aa222abcecb2c8146faf9e278248aaa3 100644 (file)
@@ -1,3 +1,14 @@
+2006-10-06  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=11183
+        REGRESSION: Safari loads error pages unstyled
+
+        * WebView/WebFrame.m:
+        (-[WebFrame _loadHTMLString:baseURL:unreachableURL:]):
+        Use utf-8 encoding instead of the string's "fastest" encoding.
+
 2006-10-06  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Adam.
index 5ec0f5f7dd18a6aa65382594ed3548e414044e71..4ea751a9d0c897fa83d5fa15579f9edf322f924b 100644 (file)
@@ -2806,18 +2806,8 @@ exit:
 
 - (void)_loadHTMLString:(NSString *)string baseURL:(NSURL *)URL unreachableURL:(NSURL *)unreachableURL
 {
-    CFStringEncoding cfencoding = CFStringGetFastestEncoding((CFStringRef)string);
-    NSStringEncoding nsencoding = CFStringConvertEncodingToNSStringEncoding(cfencoding);
-    CFStringRef cfencodingName = CFStringConvertEncodingToIANACharSetName(cfencoding);
-    
-    if (!cfencodingName || nsencoding == kCFStringEncodingInvalidId){
-        NSData *data = [string dataUsingEncoding: NSUnicodeStringEncoding];
-        [self _loadData:data MIMEType:nil textEncodingName:@"utf-16" baseURL:URL unreachableURL:unreachableURL];
-    }
-    else {
-        NSData *data = [string dataUsingEncoding: nsencoding];
-        [self _loadData:data MIMEType:nil textEncodingName:(NSString *)cfencodingName baseURL:URL unreachableURL:unreachableURL];
-    }
+    NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];
+    [self _loadData:data MIMEType:nil textEncodingName:@"UTF-8" baseURL:URL unreachableURL:unreachableURL];
 }
 
 - (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)URL