WebView and national encoding

WebView and national encoding

Postby Natter » Sun Feb 05, 2023 9: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
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: WebView and national encoding

Postby Antonio Linares » Mon Feb 06, 2023 7:52 am

Dear Yuri,

You should report it in the WebView repo issues in GitHub
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: WebView and national encoding

Postby Natter » Mon Feb 06, 2023 8:00 am

Antonio, please, specify - how do I report this in the WebView repo release on GitHub
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: WebView and national encoding

Postby Antonio Linares » Mon Feb 06, 2023 8:11 am

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: WebView and national encoding

Postby Natter » Mon Feb 06, 2023 4:42 pm

Antonio, that's what they said

https://github.com/webview/webview/issues/902
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: WebView and national encoding

Postby Natter » Tue Feb 07, 2023 9:28 am

Antonio, what should I do based on the response from GitHub ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: WebView and national encoding

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: WebView and national encoding

Postby Natter » 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
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: WebView and national encoding

Postby cnavarro » Tue Feb 07, 2023 1:16 pm

This run Ok for me
Image
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

//----------------------------------------------------------------------------//
 
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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: WebView and national encoding

Postby Natter » Tue Feb 07, 2023 1: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
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: WebView and national encoding

Postby Natter » Tue Feb 07, 2023 1:47 pm

Cristobal, copied your example. It worked. I'll figure it out
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 60 guests