Hello All,
I am new to the forum, but started with Hypercard a long long time ago (back in the se/si days) and converted to Rev when it 1st came out (so I am an old guy). My Rev development (Enterprise) is for work purposes in the forensics and eDiscovery environment.
Now that I have introduced myself, I have a question about pasting unicode into a Rev field. It use to work fine (nothing special required, just cut and paste into the field) in ver 3.5, but since I converted to 4.0, the apps I have nolonger will accept a cut and paste into a field from an html document. I have searched the forum, but I don't see anything about this. Is this a known problem/change? Thanks...
Unicode paste into field in ver 4
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Unicode paste into field in ver 4
Revolution is a good thing - Rev Enterprise, Windows environment mostly
Re: Unicode paste into field in ver 4
Dear <your name here>,
I don't think it was ever possible to paste unicode just like that, although it often does seem to work --but not always. Moreover, if you copy from an HTML page in a browser, it is really not clear whether you copy normal text, HTML, or unicode. Moroever, if the data is unicode, it is often unkown whether you are dealing with UTF8, UTF16, or UTF32. You might even have trouble with the endian. Sometimes, big trouble can arise, e.g. when you try to copy text from a Notepad file, created on Windows, into a Revolution field on the Mac. So, there are many reasons why unicode may seem to work at first, but not anymore later.
To paste unicode in a field, you need to know what type of text you are entering. You could create an Edit menu, with several Paste options. For example "Paste as is", which simply executes the paste command, "Paste as text" to put the clipboarddata["text"] into the currently selected field, and an item "Paste UTF8" to run a script, which converts the unicode data on the clipboard and sets the unicodetext of a field. You might even add Paste menu items for multiple encodings, including little and big endian.
To convert the unicode text, you can use the following syntax
Unfortunately, this can become very cumbersome, if you want to insert text in a field that contains unicode text already and even more so if you want to combine "normal" text with e.g. Arabic or Chinese. I hope that RunRev will implement a new text engine, which handles unicode correctly, soon.
Best regards,
Mark
I don't think it was ever possible to paste unicode just like that, although it often does seem to work --but not always. Moreover, if you copy from an HTML page in a browser, it is really not clear whether you copy normal text, HTML, or unicode. Moroever, if the data is unicode, it is often unkown whether you are dealing with UTF8, UTF16, or UTF32. You might even have trouble with the endian. Sometimes, big trouble can arise, e.g. when you try to copy text from a Notepad file, created on Windows, into a Revolution field on the Mac. So, there are many reasons why unicode may seem to work at first, but not anymore later.
To paste unicode in a field, you need to know what type of text you are entering. You could create an Edit menu, with several Paste options. For example "Paste as is", which simply executes the paste command, "Paste as text" to put the clipboarddata["text"] into the currently selected field, and an item "Paste UTF8" to run a script, which converts the unicode data on the clipboard and sets the unicodetext of a field. You might even add Paste menu items for multiple encodings, including little and big endian.
To convert the unicode text, you can use the following syntax
Code: Select all
if the clipboard is "unicode" then
set the unicodetext of the selectedfield to the clipboarddata["unicode"]
end if
Best regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Unicode paste into field in ver 4
Mark,
I can create a simple stack with 3.5 with 1 field and the same stack with 4.0. I go to a WEB page, copy data from the page, and it will paste into the 3.5 stack but not the 4.0 stack (same data from same page). I can paste that same data into a text file, recopy it and it will then paste into the 4.0 stack. I have never had this issue with any of the stacks I have put together over the years.
Terry
I can create a simple stack with 3.5 with 1 field and the same stack with 4.0. I go to a WEB page, copy data from the page, and it will paste into the 3.5 stack but not the 4.0 stack (same data from same page). I can paste that same data into a text file, recopy it and it will then paste into the 4.0 stack. I have never had this issue with any of the stacks I have put together over the years.
Terry
Revolution is a good thing - Rev Enterprise, Windows environment mostly
Re: Unicode paste into field in ver 4
Hi Terry,
I should have asked you right-away... which web site is this?
Best,
Mark
I should have asked you right-away... which web site is this?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Unicode paste into field in ver 4
Mark,
I have always been able to go to any WEB page (on our internal LAN or external) and copy/paste text from the pages into my Rev Stack (and standalone app) fields, that is until I went to 4.0. I copied and pasted your last reply from this forum into a 3.5 (simple stack with 1 field) field and it pastes fine, but it does not paste into a 4.0 (simple stack with 1 field) field. I am using Enterprise in a Windows environment currently. There are 3 of us here using the apps (have been for years now) I have developed and we have never had a problem with the copy/paste (we used this simple function daily with the apps). I am not disagreeing with anything you posted about unicode/UTF (good info), but something changed between the versions. Thanks for the clipboard code example, if all else fails, I may have to experiment with that direction, but to me, if my stacks/apps worked ok before, they should work ok with an upgrade (otherwise there is a bug or option that has been injected). Thanks.
Terry
I have always been able to go to any WEB page (on our internal LAN or external) and copy/paste text from the pages into my Rev Stack (and standalone app) fields, that is until I went to 4.0. I copied and pasted your last reply from this forum into a 3.5 (simple stack with 1 field) field and it pastes fine, but it does not paste into a 4.0 (simple stack with 1 field) field. I am using Enterprise in a Windows environment currently. There are 3 of us here using the apps (have been for years now) I have developed and we have never had a problem with the copy/paste (we used this simple function daily with the apps). I am not disagreeing with anything you posted about unicode/UTF (good info), but something changed between the versions. Thanks for the clipboard code example, if all else fails, I may have to experiment with that direction, but to me, if my stacks/apps worked ok before, they should work ok with an upgrade (otherwise there is a bug or option that has been injected). Thanks.
Terry
Revolution is a good thing - Rev Enterprise, Windows environment mostly