[Webkit-unassigned] [Bug 69524] [GTK] Add methods to get/set a custom text enconding to WebKit2 GTK+ API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 7 00:55:17 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=69524





--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com>  2011-10-07 00:55:17 PST ---
(In reply to comment #2)
> (From update of attachment 109953 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=109953&action=review
> 
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:48
> >      GRefPtr<WebKitWebLoaderClient> loaderClient;
> > +
> > +    CString customEncoding;
> 
> Again, I think tihs should be above under context.

Ok.

> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:293
> > + * not the default-encoding
> 
> I guess a period is needed at the nd of this comment. default-encoding -> default encoding

Ok.

> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:322
> > + * Sets the current custom text encoding name of @web_view. Any load
> > + * operation will be stopped and the page will be reloaded. This method
> > + * doesn't change the default enconding.
> > + * Setting custom text encoding to %NULL, makes @web_view to use the
> 
> Might want to mention what the effect of setting it a little more clearly. I'm guessing that is makes text documents load with a different mime type, but I'm not certain.

It has nothing to do with mime types, it's the character encoding that will be used to interpret the text.

http://en.wikipedia.org/wiki/Character_encodings_in_HTML

We can rename it to webkit_web_view_set_custom_text_character_encoding() or webkit_web_view_set_custom_charset(). GLib uses charset in its API, so it would be consistent.

> > Source/WebKit2/UIProcess/API/gtk/tests/testwebview.c:43
> > +    WebKitWebView *view = WEBKIT_WEB_VIEW(webkit_web_view_new());
> > +    g_object_ref_sink(view);
> > +
> > +    g_assert(!webkit_web_view_get_custom_text_encoding(view));
> > +    webkit_web_view_set_custom_text_encoding(view, "utf8");
> > +    g_assert_cmpstr(webkit_web_view_get_custom_text_encoding(view), ==, "utf8");
> > +    /* Go back to the default enconding */
> > +    webkit_web_view_set_custom_text_encoding(view, NULL);
> > +    g_assert(!webkit_web_view_get_custom_text_encoding(view));
> > +    g_object_unref(view);
> 
> Here I think you should load a text document and verify that the mime type is what you expect.

We don't have API to get the mime-type yet.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list