WebView and national encoding

Post Reply
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

WebView and national encoding

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 42520
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: WebView and national encoding

Post by Antonio Linares »

Dear Yuri,

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

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: WebView and national encoding

Post by Natter »

Antonio, please, specify - how do I report this in the WebView repo release on GitHub
User avatar
Antonio Linares
Site Admin
Posts: 42520
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: WebView and national encoding

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: WebView and national encoding

Post by Natter »

Antonio, that's what they said

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

Re: WebView and national encoding

Post by Natter »

Antonio, what should I do based on the response from GitHub ?
User avatar
Antonio Linares
Site Admin
Posts: 42520
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: WebView and national encoding

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: WebView and national encoding

Post 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
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: WebView and national encoding

Post by cnavarro »

This run Ok for me
Image

Code: Select all | Expand


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

Re: WebView and national encoding

Post by Natter »

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: 1241
Joined: Mon May 14, 2007 9:49 am

Re: WebView and national encoding

Post by Natter »

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