Just starting out? Need help? Post your questions and find answers here.
Paradox
User
Posts: 23 Joined: Tue Dec 09, 2014 7:16 pm
Location: Brasil
Post
by Paradox » Wed Feb 21, 2018 8:35 pm
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:
RASHAD
PureBasic Expert
Posts: 4661 Joined: Sun Apr 12, 2009 6:27 am
Post
by RASHAD » Wed Feb 21, 2018 8:51 pm
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>Ã É Í </h1> "+
"</body> "+
"</html> "
SetGadgetItemText(web_gadget,#PB_Web_HtmlCode,html_code$)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EndProcedure
teste()
Egypt my love
Bisonte
Addict
Posts: 1232 Joined: Tue Oct 09, 2007 2:15 am
Post
by Bisonte » Wed Feb 21, 2018 8:55 pm
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()
P ureB asic 6.10 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom
English is not my native language...
(I often use DeepL to translate my texts.)
Paradox
User
Posts: 23 Joined: Tue Dec 09, 2014 7:16 pm
Location: Brasil
Post
by Paradox » Wed Feb 21, 2018 9:05 pm
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!!