WebGadget and accents

Just starting out? Need help? Post your questions and find answers here.
papet34
User
User
Posts: 11
Joined: Fri Feb 15, 2019 11:16 am
Location: France

WebGadget and accents

Post by papet34 »

Sorry but it's still about the accents ...
Accents in file or directory names are not supported by the WebGadget. Is this normal?

OpenWindow(0, 10, 10, 1200, 500, "Essai", #PB_Window_SystemMenu)
cat1$ = "Reaction" : cat2$ = "Réaction"
t1$ = "e.html" : t2$ = "é.html"
gRacine$ = "/PureBasic/"
Debug FileSize(gRacine$ + cat1$ + #PS$ + t1$) ; ok
WebGadget(0, 0, 0, 400, 500, "file:" + #PS$ + #PS$ + "Dur" + gRacine$ + cat1$ + #PS$ + t1$) ; ok
Debug FileSize(gRacine$ + cat2$ + #PS$ + t1$) ; ok
WebGadget(1, 401, 0, 400, 500, "file:" + #PS$ + #PS$ + "Dur" + gRacine$ + cat2$ + #PS$ + t1$) ; !!!
Debug FileSize(gRacine$ + cat1$ + #PS$ + t2$) ; ok
WebGadget(2, 801, 0, 400, 500, "file:" + #PS$ + #PS$ + "Dur" + gRacine$ + cat1$ + #PS$ + t2$) ; !!!
Repeat
evt = WaitWindowEvent()
Until evt = #PB_Event_CloseWindow
Sorry for my poor english
j@cques
User avatar
Bisonte
Addict
Addict
Posts: 1233
Joined: Tue Oct 09, 2007 2:15 am

Re: WebGadget and accents

Post by Bisonte »

What if you build the string with UrlEncoder() ?

Code: Select all

OpenWindow(0, 10, 10, 1200, 500, "Essai", #PB_Window_SystemMenu)
cat1$ = "Reaction" : cat2$ = "Réaction"
t1$ = "e.html" : t2$ = "é.html"
gRacine$ = "/PureBasic/"
Debug FileSize(gRacine$ + cat1$ + #PS$ + t1$) ; ok
WebGadget(0, 0, 0, 400, 500, URLEncoder("file:" + #PS$ + #PS$ + "Dur" + gRacine$ + cat1$ + #PS$ + t1$)) ; ok
Debug FileSize(gRacine$ + cat2$ + #PS$ + t1$) ; ok
WebGadget(1, 401, 0, 400, 500, URLEncoder("file:" + #PS$ + #PS$ + "Dur" + gRacine$ + cat2$ + #PS$ + t1$)) ; !!!
Debug FileSize(gRacine$ + cat1$ + #PS$ + t2$) ; ok
WebGadget(2, 801, 0, 400, 500, URLEncoder("file:" + #PS$ + #PS$ + "Dur" + gRacine$ + cat1$ + #PS$ + t2$)) ; !!!
Repeat
evt = WaitWindowEvent()
Until evt = #PB_Event_CloseWindow
PureBasic 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.)
papet34
User
User
Posts: 11
Joined: Fri Feb 15, 2019 11:16 am
Location: France

Re: WebGadget and accents

Post by papet34 »

Thank you Bisonte.
It's better ! With UrlEncoder, WebGadget # 1 (repertory name with accent) works fine.
WebGadget # 2 (file name with accent) still does not display ...
Sorry for my poor english
j@cques
papet34
User
User
Posts: 11
Joined: Fri Feb 15, 2019 11:16 am
Location: France

Re: WebGadget and accents

Post by papet34 »

Oups ! It's also ok with WebGadget #2.
Thanks Bisonte.
Sorry for my poor english
j@cques
Post Reply