encoding woes!?

hh hh at hyperhh.de
Tue Oct 29 17:06:06 EDT 2019


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.

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.

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").

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).




More information about the use-livecode mailing list