encoding woes!?

Klaus major-k klaus at major-k.de
Tue Oct 29 17:21:45 EDT 2019


Hello Hermann,

> Am 29.10.2019 um 22:06 schrieb hh via use-livecode <use-livecode at lists.runrev.com>:
> 
> Hi Klaus,
> 
> this is dangerous because the code could have "mixed" encodings
> if you (or your partner) edits the code in texteditors with
> different encoding settings.

we both use the same stack, so no text editor involved.

> I looked again carefully into your first post.
> You use the htmltext of the widget, so your original code is correct.
> It works here as you would like.
> 
> So delete the file test.html and write it new by LC using 
> put textencode(the htmltext of widget "browser","UTF8") \
>  into url("file:" & specialfolderpath("desktop") & "/test.html")
> 
> Possibly there was some problem when you self-created the file.
> I set the default encoding in BBEdit to UTF-8.

I used BBEdit with encoding set to UTF-8 for the "skeletal structure"
of the HTML file, HEADER and a little inline CSS.

> Also LiveCode uses a BOM. If there is no UTF-8 BOM it uses
> Mac OS Roman. That is what you see when you type into msg
> put textEncode(the htmltext of widget "Browser", "UTF-8").

Which shows exactly the same (with umlauts and stuff) as simply:
put the htmltext of widget "Browser"

> If you use later on text from the DOM structure of your HTML,
> have to decode before using in LC/writing to a file.
> handlers.
> I use this always together with base64Encoding (because javascript
> handlers need ONE line of code in quotes).

Well you have a much deeper knowledge about all this stuff than I will ever have
and I hardly understand what you are trying to tell me with these last two sentences. :-D

Thanks for you help, very appreciated!


Best

Klaus
--
Klaus Major
https://www.major-k.de
klaus at major-k.de





More information about the use-livecode mailing list