FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour WebView and national encoding
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
WebView and national encoding
Posted: Sun Feb 05, 2023 09:25 AM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: WebView and national encoding
Posted: Mon Feb 06, 2023 07:52 AM

Dear Yuri,

You should report it in the WebView repo issues in GitHub

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: WebView and national encoding
Posted: Mon Feb 06, 2023 08:00 AM

Antonio, please, specify - how do I report this in the WebView repo release on GitHub

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: WebView and national encoding
Posted: Mon Feb 06, 2023 08:11 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: WebView and national encoding
Posted: Mon Feb 06, 2023 04:42 PM

Antonio, that's what they said

https://github.com/webview/webview/issues/902

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: WebView and national encoding
Posted: Tue Feb 07, 2023 09:28 AM

Antonio, what should I do based on the response from GitHub ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: WebView and national encoding
Posted: Tue Feb 07, 2023 10:50 AM

Dear Yuri,

Have you tried this ?

Try adding <meta charset="UTF-8" /> to your <head> and see if that resolves your issue.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: WebView and national encoding
Posted: Tue Feb 07, 2023 11:03 AM

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

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: WebView and national encoding
Posted: Tue Feb 07, 2023 01:16 PM
This run Ok for me

Code (fw): Select all Collapse
#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

//----------------------------------------------------------------------------//
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: WebView and national encoding
Posted: Tue Feb 07, 2023 01:40 PM

Cristobal, it's just mysticism, it doesn't work for me. :shock:
An empty Webview window appears. I have version 109.0.1518.78

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: WebView and national encoding
Posted: Tue Feb 07, 2023 01:47 PM

Cristobal, copied your example. It worked. I'll figure it out

Continue the discussion