Bug 16056

Summary: Unicode not being interpreted correctly in Web Inspector source view
Product: WebKit Reporter: Dominic Mitchell <dom>
Component: Web Inspector (Deprecated)Assignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Minor CC: ap, sam
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://plasmasturm.org/about/
Attachments:
Description Flags
Correctly rendered view of the page.
none
Correctly rendered view in the DOM inspector.
none
Incorrectly rendered in the source inspector.
none
proposed fix aroben: review+

Description Dominic Mitchell 2007-11-19 13:38:46 PST
Looking at this page, the Name: Αριστοτέλης Παγκαλτζής renders correctly.

If you look at that name in the DOM view of web inspector, it's correct.

However, if you look at the source code view of web inspector, it's wrong.  It looks like it's being shown as ISO-8859-1 instead of UTF-8.

This could be down to the page being application/xhtml+xml instead of text/html.
Comment 1 Dominic Mitchell 2007-11-19 13:39:21 PST
Created attachment 17407 [details]
Correctly rendered view of the page.
Comment 2 Dominic Mitchell 2007-11-19 13:40:00 PST
Created attachment 17408 [details]
Correctly rendered view in the DOM inspector.
Comment 3 Dominic Mitchell 2007-11-19 13:40:43 PST
Created attachment 17409 [details]
Incorrectly rendered in the source inspector.
Comment 4 Alexey Proskuryakov 2007-11-19 22:50:55 PST
Confirmed with r27834.
Comment 5 Alexey Proskuryakov 2007-11-20 14:19:20 PST
Created attachment 17420 [details]
proposed fix
Comment 6 Adam Roben (:aroben) 2007-11-20 14:24:45 PST
Comment on attachment 17420 [details]
proposed fix

+    if (resource->requestURL == resource->loader->requestURL()) {
         buffer = resource->loader->mainResourceData();
-    else {
+        textEncodingName = resource->loader->frame()->document()->inputEncoding();
+    } else {

Don't need braces here

+        virtual String encoding() const;

Can these methods return a const String&? Or are they returning transient Strings?

r=me
Comment 7 David Kilzer (:ddkilzer) 2007-11-20 15:21:57 PST
(In reply to comment #6)
> (From update of attachment 17420 [details] [edit])
> +    if (resource->requestURL == resource->loader->requestURL()) {
>          buffer = resource->loader->mainResourceData();
> -    else {
> +        textEncodingName =
> resource->loader->frame()->document()->inputEncoding();
> +    } else {
> 
> Don't need braces here

I think you DO need braces here.  :)

Comment 8 Alexey Proskuryakov 2007-11-21 00:10:38 PST
Committed revision 27937.

Comment 9 Dominic Mitchell 2007-11-21 13:00:40 PST
Wow!  Thanks for the quick attention!