Bug 16056 - Unicode not being interpreted correctly in Web Inspector source view
Summary: Unicode not being interpreted correctly in Web Inspector source view
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.5
: P2 Minor
Assignee: Alexey Proskuryakov
URL: http://plasmasturm.org/about/
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-19 13:38 PST by Dominic Mitchell
Modified: 2007-11-21 13:00 PST (History)
2 users (show)

See Also:


Attachments
Correctly rendered view of the page. (61.56 KB, image/png)
2007-11-19 13:39 PST, Dominic Mitchell
no flags Details
Correctly rendered view in the DOM inspector. (103.37 KB, image/png)
2007-11-19 13:40 PST, Dominic Mitchell
no flags Details
Incorrectly rendered in the source inspector. (135.09 KB, image/png)
2007-11-19 13:40 PST, Dominic Mitchell
no flags Details
proposed fix (8.02 KB, patch)
2007-11-20 14:19 PST, Alexey Proskuryakov
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!