[webkit-gtk] guchar * sometimes a utf8, sometimes utf16?

Michael Catanzaro mcatanzaro at igalia.com
Mon Jun 4 15:43:38 PDT 2018

On Mon, Jun 4, 2018 at 2:49 PM, Leo Ufimtsev <Leonidas at redhat.com> 
> How did webkit1's 'webkit_web_data_source_get_encoding()' function 
> retrieve the encoding and is there a way to do the same on webkit2?

I didn't know about this!

Looking at the old source code, it checked 
DocumentLoader::overrideEncoding. If that was set, then it used that as 
the encoding. If not, it used DocumentLoader::response to get the 
ResourceResponse of the DocumentLoader, and then called 
ResourceResponse::textEncodingName (getting the encoding from the HTTP 

It would probably be desirable to implement API to expose this. 
DocumentLoader lives in the web process now, so it's going to require 
adding an IPC message, probably between WebPage in the web process and 
WebPageProxy in the UI process. Then WebKitWebResource would be able to 
use that.


More information about the webkit-gtk mailing list