Page 1 of 1

Charset #PB_Web_HtmlCode

Posted: Wed Feb 21, 2018 8:35 pm
by Paradox
Not display characters Ã É Í

Code:

Code: Select all

Procedure teste()
  If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
    Protected web_gadget = WebGadget(#PB_Any, 10, 10, 580, 280, #Null$) 
    Protected html_code$ = "<!DOCTYPE html> "+
                           "<html lang='en'> "+
                           "<head> "+
                           "    <meta charset='UTF-8'> "+
                           "    <title></title> "+
                           " </head> "+
                           " "+
                           "<body class='landscape'> "+
                           "	<h1>Ã É Í </h1> "+
                           "</body> "+
                           "</html> "
    SetGadgetItemText(web_gadget,#PB_Web_HtmlCode,html_code$)
    Repeat 
    Until WaitWindowEvent() = #PB_Event_CloseWindow 
  EndIf
EndProcedure

teste()
Result:
Image

Re: Charset #PB_Web_HtmlCode

Posted: Wed Feb 21, 2018 8:51 pm
by RASHAD
Hi
Use Html character code

Code: Select all

Procedure teste()
  If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    Protected web_gadget = WebGadget(#PB_Any, 10, 10, 580, 280, #Null$)
    Protected html_code$ = "<!DOCTYPE html> "+
                           "<html lang='en'> "+
                           "<head> "+
                           "    <meta charset='UTF-8'> "+
                           "    <title></title> "+
                           " </head> "+
                           " "+
                           "<body class='landscape'> "+
                           "   <h1>&Atilde; &Eacute; &Iacute; </h1> "+
                           "</body> "+
                           "</html> "
    SetGadgetItemText(web_gadget,#PB_Web_HtmlCode,html_code$)
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
EndProcedure

teste() 

Re: Charset #PB_Web_HtmlCode

Posted: Wed Feb 21, 2018 8:55 pm
by Bisonte
Or without the meta tag :

Code: Select all

Procedure teste()
  If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    Protected web_gadget = WebGadget(#PB_Any, 10, 10, 580, 280, #Null$)
    Protected html_code$ = "<!DOCTYPE html> "+
                           "<html lang='en'> "+
                           "<head> "+
                           ""+
                           "    <title></title> "+
                           " </head> "+
                           " "+
                           "<body class='landscape'> "+
                           "   <h1>Ã É Í </h1> "+
                           "</body> "+
                           "</html> "
    SetGadgetItemText(web_gadget,#PB_Web_HtmlCode,html_code$)
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
EndProcedure

teste() 

Re: Charset #PB_Web_HtmlCode

Posted: Wed Feb 21, 2018 9:05 pm
by Paradox
Bisonte wrote:Or without the meta tag :

Code: Select all

Procedure teste()
  If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    Protected web_gadget = WebGadget(#PB_Any, 10, 10, 580, 280, #Null$)
    Protected html_code$ = "<!DOCTYPE html> "+
                           "<html lang='en'> "+
                           "<head> "+
                           ""+
                           "    <title></title> "+
                           " </head> "+
                           " "+
                           "<body class='landscape'> "+
                           "   <h1>Ã É Í </h1> "+
                           "</body> "+
                           "</html> "
    SetGadgetItemText(web_gadget,#PB_Web_HtmlCode,html_code$)
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
EndProcedure

teste() 

Thanks!!