views:

21

answers:

2

I'm working on an app which involves the use of webkitgtk. It works fine except non-english characters. Example, webkitgtk widget does not render the following Russian text correctly.

Пишу в English, значит все в порядке. Спасибо!

It rather display this,

Пишу в English, значит вÑе в порÑдке. СпаÑибо!

How do I make webkitgtk display international text correctly?

A: 

You need to do character set conversion. Glib offers a great interface to do so.

Praveen S
Why is the downvote for? I thought the link provided enough information about the APIs for character set conversion.
Praveen S
+2  A: 

The displayed string looks like UTF-8-encoded string interpreted as ISO-8859-1-encoded string. You should correctly set encoding.

E.g., if you are loading the HTML string into WebKitWebView, you should correctly specify its encoding (via encoding argument to webkit_web_view_load_string).

If you are loading a web page from the internet, make sure that its encoding is correctly specified (http server sends the correct Content-Type header or web page has correct http-equiv="Content-Type" specification).

WebKit engine itself should handle multilingual texts fine.

dmitry_vk
I already fixed it yesterday by setting encoding to UTF-8. Thanks.
Owais Lone