encoding woes!?

hh hh at hyperhh.de
Tue Oct 29 15:02:01 EDT 2019


Just saw it now, overlooked that first:

You script
put textencode(tTExt,"UTF8") into url ("file": ...)

This should read
put textDecode(tTExt,"UTF8") into url ("file": ...)

=====

But why using files?
If you don't want to type directly in the browser widget
you can make it "mirroring" a text field.

Example for a primitve HTML editor:

1. Write into fld "HTML"
<html><head><meta charset="utf-8"></head>
<body>[[ht]]</body></html>
(You can now hide fld "HTML").

2. Then make a field "Tippse" and script it:

on textchanged
  put the htmltext of me into ht
  replace "</p>" with "<br>" in ht
  replace "<p>" with empty in ht
  set htmltext of widget "browser" to merge(fld "HTML")
end textchanged

on enterInField
  textchanged
end enterInField

Then you can do what your textfield allows
set textfont (bears some problems), textsize, styles etc.
and the widget will display it (well, approximately...)

[Another variant is to write directly into the DOM structure
of the current HTMLtext.]




More information about the use-livecode mailing list