Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
turdidae
Posts: 15
Registered: ‎06-02-2012
My Device: BlackBerry 10 Dev Alpha

Manualy set characters encoding in WebView

Hi All :smileyhappy:

 

I've strange problem with WebView in Cascades (QML) web page that I need to open and show is using UTF-8 but there is no declaration in <head> and WebView shows it with ISO-8859-2 encoding.

 

Can I do something with that?

 

 

Thanks

Krzysiek

Developer
tommy20
Posts: 262
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: Manualy set characters encoding in WebView

Hi Krzysiek,

I have the same problem, how do you set the encoding for the webview? say UTF-8

thanks
--tom
Developer
congdanhqx
Posts: 115
Registered: ‎10-22-2012
My Device: Developer

Re: Manualy set characters encoding in WebView

Take a look here:

https://developer.blackberry.com/cascades/reference/bb__cascades__webview.html#property-settings

and here:

https://developer.blackberry.com/cascades/reference/bb__cascades__websettings.html#property-defaultt...

Maybe what you need is:

In QML

webView.settings.defaultTextCodecName = "UTF-8"

in C++:

pWebView->settings()->setDefaultTextCodecName (QString("UTF-8"));

 



Like my answer if it's helpful. Mark as answer if it help you solve the problem.