Unicode and revBrowser: "selected" property and callback messages

Slava Paperno slava at lexiconbridge.com
Sun May 29 15:21:38 EDT 2011


Mike's brilliant suggestion is to use browserBeforeNavigate() for passing
back a string to the stack via the URL parameter.Very smart and original,
especially since that can be done on dblclick--an event that otherwise
cannot be captured by revBrowser.

That doesn't resolve the Unicode problem, but my solution for that now is to
use JavaScript for turning the string into a list of decimal numbers--the
code points of all the characters in the string--and pass that list as a
parameter, and then on the LC side to turn the numbers back into characters
and reassemble the string.

This works fine. It is, of course, a kludge, although one that doesn't
involve any performance penalty. It would be easier for people to learn and
to adopt LC if these things were not necessary, so I still think it would be
a reasonable feature request, along with more transparent Unicode support
everywhere else.

For example, you can't type or display Unicode in the Variable Watcher, or
Message Box, or script, or the answer and ask boxes (w/o resorting to a
really impossible kludge of using HTML entities), and for any string
processing you have to convert the UTF16 text in a field to a UTF8 string,
and then convert the results of your processing back to UTF16 for display;
and you have to remember that length(MyStr) returns the number of bytes, not
the number of characters, and so when you use it on a field the result will
be different than when you use it on the variable that holds the same text,
etc. Then there is this really weird way to refer to a single character as a
sequence of two characters because each byte in a double-byte string is
treated as a character... Not a very friendly programming environment. 

When I am done with my proof-of-concept stack, and overcome whatever other
hurdles there may be, I will submit the source file and comments to RunRev,
and hope that it may be useful for someone down the road.

You have been very responsive and helpful, Jacqueline, and so has Mike, and
I am truly grateful. There are still parts of the process that I haven't
experimented with, and I am sure I will be posting more puzzling questions
for the experts like you, and Mike, and Elanor, and the rest of the list.

Kind regards,

Slava



> -----Original Message-----
> From: use-livecode-bounces at lists.runrev.com [mailto:use-livecode-
> bounces at lists.runrev.com] On Behalf Of J. Landman Gay
> Sent: Sunday, May 29, 2011 12:03 PM
> To: How to use LiveCode
> Subject: Re: Unicode and revBrowser: "selected" property and callback
> messages
> 
> On 5/29/11 7:37 AM, Slava Paperno wrote:
> > Thanks for thinking about this, Jacqueline. The problem persists.
> 
>  From all you've tried so far, it does look like the selected text
> isn't
> compatible with unicode. Please let us know if you can use Mike's
> workaround, I think a lot of people will want to know. And if you can
> submit a feature request to the QCC, that would be great too. Or if
> you'd rather I do it, let me know.
> 
> --
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode






More information about the use-livecode mailing list