text encoding gotcha?

Alex Rice alex at mindlube.com
Wed Jan 14 02:00:24 EST 2004


On Jan 13, 2004, at 11:36 PM, Alejandro Tejada wrote:
> Actually is useful that Revolution left the
> clipboard in their native state. You can paste
> images and paths to files in this way.
>
> Most recent apps do not convert either the data
> in the clipboard.
>
> When I need unformatted text, I paste first in
> notepad and then copy from notepad to paste
> in the application.

I strongly disagree. The IDE has a special responsibility. When the 
only sane type of paste operation is plain text then that's it should 
accept.

What happens now is it breaks the IDE, causes scripts not to compile, 
and causes weird cross platform problems that don't get noticed until 
much later.

The main point is that *I had no way of knowing* that this text was 
twice as long as it appeared, and every other character was a null. It 
appeared to be unformatted text that got pasted. It wasn't unicode, it 
wasn't rich text, it had no formatting- so what the heck was it?

When I copy from Excel on the pasteboardData are the types:

text
html
rtf
objects

Based on the lengths of those the data, I am pretty sure the IDE is 
taking the "objects" value instead of the "text" value.

I guess I'll have to write a plugin to trim the contents of the 
pasteboardData to prevent the IDE doing something stupid with it like 
pasting binary data into the script editor or something.


Alex Rice <alex at mindlube.com> | Mindlube Software | 
<http://mindlube.com>

what a waste of thumbs that are opposable
to make machines that are disposable  -Ani DiFranco



More information about the use-livecode mailing list