On 29 Jul 2022 as I do recall,
Post by Chris NewmanPost by Harriet BazleyI have a ConvText script that does a search-and-replace for various
UTF8 characters so that I can actually reply to e-mails in StrongED; I
believe that recent version of Messenger Pro's internal e-mail editor
do actually support UTF8, but I have a lot of shortcuts and formatting
options setup in StrongED.
Sounds good, Harriet. I haven't used ConvText for ages. Do share how it's
done, please.
ConvText syntax is simply <find string> <colon> <replace string>
So you run the app, select "New script" from the iconbar menu, which
will open a blank file with the keyword "SCRIPT:" already entered for
you, give the new script a name (e.g. "SCRIPT: UTF8"), and then enter
all your desired substitutions one by one. UTF8 characters are
generally two bytes wide and translate to a single Latin-1 character. I
normally cut and paste the literal strings as I encounter them, but you
can also encode them in square brackets using their ASCII codes, which
is safer for Usenet purposes.
So the translation
é:� (e-acute)
can more portably be written
[195][169]:[233]
You can add comments using the vertical pipe character, e.g.
[140]:... |Ellipse to three full stops
In order to use your new script, simply save the file and make sure your
new entry is selected in the Scripts sub-menu. Then drag the text you
want to convert to ConvText's iconbar icon, where it will pop up a
savebox to be dragged anywhere sensible. What I usually do is start my
reply in StrongED, select all, drag the selection to ConvText, delete
the selected text in the StrongED message reply window and drag the
ConvText savebox back to save the converted text into the now-empty
window, thus retaining the OLE link from Messenger by keeping the same
file but updating its contents.
You could also do something similar from within StrongED itself, by
updating the News mode to contain a user-defined menu entry that
performs a set of pre-defined search & replace operations, or by using
one of the scripting languages (Lua, awk, BASIC, Python, Perl) which
StrongED knows about in order to apply a script to the contents of the
current window.
I did have a reasonably elegant Lua script for StrongED that did a
general gsub operation with the replacement string simply being a table
holding the UTF8 translations in it; I had to do two passes, one for
the two-character substitutions and then another one for the
three-character substitutions, but it worked. I'm not sure what
happened to it!
--
Harriet Bazley == Loyaulte me lie ==
He who hesitates is sometimes saved.