how to load a local file into the browser widget?

Curt Ford curt at sonasoftware.com
Sat May 25 12:15:35 EDT 2019


Thanks, hh, that does it! :)

*answer*file"Choose an html file"

*put*urlEncode(textEncode(it, "UTF-8")) intotPathWithCyrillic

*set*theurlofwidget"Browser"totPathWithCyrillic


Occasional accents & punctuation in the file names are not causing 
problems either (so far). But then the spaces..

*replace*" "with"%20"intPathWithCyrillic

didn't work since the urlEncode was inserting "+" where it found a space.

So replacing "+" with "%20" fixes that. Final version:

*answer*file"Choose an html file"

*put*urlEncode(textEncode(it, "UTF-8")) intotPathWithCyrillic

*replace*"+"with"%20"intPathWithCyrillic

*set*theurlofwidget"Browser"totPathWithCyrillic

Thanks everyone!

Curt


> You could try to use (for example):
>
> urlEncode(textEncode("брать","UTF-8"))


-- 
Sent from Postbox 
<https://www.postbox-inc.com/?utm_source=email&utm_medium=siglink&utm_campaign=reach>



More information about the use-livecode mailing list