Page 1 of 1
WebView and national encoding
Posted:
Sun Feb 05, 2023 9:25 am
by Natter
WebView does not support national encoding (for example Cyrillic) in HTML text. If in the example of Webdunia.prg the name of the button "Test 2" is replaced with a Cyrillic name, then the WebView window will be empty
Re: WebView and national encoding
Posted:
Mon Feb 06, 2023 7:52 am
by Antonio Linares
Dear Yuri,
You should report it in the WebView repo issues in GitHub
Re: WebView and national encoding
Posted:
Mon Feb 06, 2023 8:00 am
by Natter
Antonio, please, specify - how do I report this in the WebView repo release on GitHub
Re: WebView and national encoding
Posted:
Mon Feb 06, 2023 8:11 am
by Antonio Linares
Re: WebView and national encoding
Posted:
Mon Feb 06, 2023 4:42 pm
by Natter
Re: WebView and national encoding
Posted:
Tue Feb 07, 2023 9:28 am
by Natter
Antonio, what should I do based on the response from GitHub ?
Re: WebView and national encoding
Posted:
Tue Feb 07, 2023 10:50 am
by Antonio Linares
Dear Yuri,
Have you tried this ?
Try adding <meta charset="UTF-8" /> to your <head> and see if that resolves your issue.
Re: WebView and national encoding
Posted:
Tue Feb 07, 2023 11:03 am
by Natter
It didn't help. I tried both under Harbour and under xHarbour
For example, when configuring Cisco, it is also impossible to make a comment in Cyrillic. Very similar
Re: WebView and national encoding
Posted:
Tue Feb 07, 2023 1:16 pm
by cnavarro
This run Ok for me
- Code: Select all Expand view
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oWebView
oWebView := TWebView():New()
oWebView:bOnBind = { | cJson, nCalls | MsgInfo( cJson, nCalls ) }
oWebView:Bind( "SendToFWH" )
oWebView:Navigate( Html() )
Sleep( 200 )
oWebView:Eval( "SendToFWH( 'ok' )" )
oWebView:Run()
oWebView:Destroy()
return nil
//----------------------------------------------------------------------------//
function Html()
local cHtml
TEXT INTO cHtml
data:text/html,
<html>
<head>
<meta charset="UTF-8" />
</head>
<body style="background-color:cyan">
<h2>Using WebView from FWH</h2>
<button onclick='SendToFWH( 123 )'>Call FWH app from web browser</button>
<button onclick='SendToFWH( 456 )'>Test 2 Пример</button>
<button onclick='SendToFWH( 123, 456, "yes it works!" )'>Test 3</button>
</body>
</html>
ENDTEXT
? cHtml
return cHtml
//----------------------------------------------------------------------------//
Re: WebView and national encoding
Posted:
Tue Feb 07, 2023 1:40 pm
by Natter
Cristobal, it's just mysticism, it doesn't work for me.
An empty Webview window appears. I have version 109.0.1518.78
Re: WebView and national encoding
Posted:
Tue Feb 07, 2023 1:47 pm
by Natter
Cristobal, copied your example. It worked. I'll figure it out