Using non Roman chars in fields and variables
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Using non Roman chars in fields and variables
Hello from France.
I have a simple field, font used: Helvetica ( Os X)
When i paste text with in greek japanese, arabic..., the text is pasted and shows correctly
exemples:
δοκιμή@παράδειγμα.δοκιμή
我買@屋企.香港
甲斐@黒川.日本
чебурашка@ящик-с-апельсинами.рф
when i copy the field in a variable, or just put a line of this field to another field,all the non roman chars are replaced with "?"
So, how can i know this field contains non roman chars ?
Cordialy, Joan.
I have a simple field, font used: Helvetica ( Os X)
When i paste text with in greek japanese, arabic..., the text is pasted and shows correctly
exemples:
δοκιμή@παράδειγμα.δοκιμή
我買@屋企.香港
甲斐@黒川.日本
чебурашка@ящик-с-апельсинами.рф
when i copy the field in a variable, or just put a line of this field to another field,all the non roman chars are replaced with "?"
So, how can i know this field contains non roman chars ?
Cordialy, Joan.
Re: Using non Roman chars in fields and variables
Are you using v.7, which supports unicode?
I am out of my depth here, but the little I know makes me think this will address your issues.
Craig Newman
I am out of my depth here, but the little I know makes me think this will address your issues.
Craig Newman
Re: Using non Roman chars in fields and variables
Hi Joan,
supposing you are using a LiveCode version < 7
You see the non-Roman characters when pasting because Livecode uses the html of the pasting.
If you want to keep non-roman characters when putting them into a variable use the htmlText
note how you need to "set the htmlText" because it is a property of the field.
if you want to see the htmlText of field "myField1" then
Kind regards
Bernd
then you can edit the code in field "lookAthtmlText" and send it back to field "myField1" by
all code tested with your example non-roman text from this post
All this gets complicated and as Craig said in LC 7 and above you should not have to do all this
Kind regards
Bernd
supposing you are using a LiveCode version < 7
You see the non-Roman characters when pasting because Livecode uses the html of the pasting.
If you want to keep non-roman characters when putting them into a variable use the htmlText
Code: Select all
put the htmlText of field "myField1" into tMyVariable
Code: Select all
set the htmlText of line x of field "myField2" to line 2 of tMyVariable
Code: Select all
set the htmlText of line x of field "myField2" to the htmlText of line x of field "myField1"
Code: Select all
put the htmlText of field "myField1" into field "lookAthtmlText"
Bernd
then you can edit the code in field "lookAthtmlText" and send it back to field "myField1" by
Code: Select all
set the htmlText of field "myField1" to field "lookAthtmlText"
All this gets complicated and as Craig said in LC 7 and above you should not have to do all this
Kind regards
Bernd
Re: Using non Roman chars in fields and variables
Hello.
Thanks for your reply.
Maybe i use the htmlText, but i need doing more than copying lines of htmlText in variables ( i must filter chars from non roman alphabets, so i probably need using unicode functions too)
I still use LC 6.6.2 because LC 7 rc2 runtimes are catastrophic under Windows ( XP and seven under //Desktop 8 on Mac) and crash systematically after launching.
And the rendering of the Windows runtimes created with LC 7 are horrible.
Well, nothing works with LC 7 Windows runtimes....
So for the moment i must stay with LC 6 and i plan to abandon LC promptly if the huge bugs of version 7 are not resolved.
Cordially, Joan.
Thanks for your reply.
Maybe i use the htmlText, but i need doing more than copying lines of htmlText in variables ( i must filter chars from non roman alphabets, so i probably need using unicode functions too)
I still use LC 6.6.2 because LC 7 rc2 runtimes are catastrophic under Windows ( XP and seven under //Desktop 8 on Mac) and crash systematically after launching.
And the rendering of the Windows runtimes created with LC 7 are horrible.
Well, nothing works with LC 7 Windows runtimes....
So for the moment i must stay with LC 6 and i plan to abandon LC promptly if the huge bugs of version 7 are not resolved.
Cordially, Joan.
Re: Using non Roman chars in fields and variables
Bernd.
I thought of advising using the htmlText, but was not sure of myself. I have used that, but only to maintain style properties. This will also keep non-ASCII chars intact as well?
Craig
I thought of advising using the htmlText, but was not sure of myself. I have used that, but only to maintain style properties. This will also keep non-ASCII chars intact as well?
Craig
Re: Using non Roman chars in fields and variables
@Craig,
yes, because they are in the form of html and that is all ASCII
e.g.
this is the example Joan posted
@Joan,
try with the latest release candidate to see the progress. Livecode is actively fixing bugs and improving speed. It is not yet up to speed with version < 7 but for many things it might well be fast enough.
http://downloads.livecode.com/livecode/
currently LC 7.0.1 RC 3 is the latest version.
RC3 means it is not yet fully released, it is a Release Candidate. So don't build your final app with it. Just test it. And if you find crashes try to reproduce them in a systematic manner and go over to Quality Control Center and bug-report them. They need to know and want to get this out as stable and smooth as possible.
http://quality.runrev.com
I think it is worth the wait.
You can do all the unicode stuff in versions below 7 but it is a pain. Aside from using htmlText I avoid unicode and am lucky that I don't have to use it.
Kind regards
Bernd
yes, because they are in the form of html and that is all ASCII
e.g.
Code: Select all
<p><font face="Lucida Grande" size="13" color="#262626" bgcolor="#E7F0F5">δοκιμή@παράδειγμα.δοκιμή</font></p>
<p><font face="Lucida Grande" size="13" color="#262626" bgcolor="#E7F0F5">我買@屋企.香港</font></p>
<p><font face="Lucida Grande" size="13" color="#262626" bgcolor="#E7F0F5">甲斐@黒川.日本</font></p>
<p><font face="Lucida Grande" size="13" color="#262626" bgcolor="#E7F0F5">чебурашка@ящик-с-апельсинами.рф</font></p>
@Joan,
try with the latest release candidate to see the progress. Livecode is actively fixing bugs and improving speed. It is not yet up to speed with version < 7 but for many things it might well be fast enough.
http://downloads.livecode.com/livecode/
currently LC 7.0.1 RC 3 is the latest version.
RC3 means it is not yet fully released, it is a Release Candidate. So don't build your final app with it. Just test it. And if you find crashes try to reproduce them in a systematic manner and go over to Quality Control Center and bug-report them. They need to know and want to get this out as stable and smooth as possible.
http://quality.runrev.com
I think it is worth the wait.
You can do all the unicode stuff in versions below 7 but it is a pain. Aside from using htmlText I avoid unicode and am lucky that I don't have to use it.
Kind regards
Bernd
Re: Using non Roman chars in fields and variables
Hi Joan,
Please don't use htmlText for this task. You're dealing with unicode, so use the unicode properties and functions. I selected and copied the sample text from your first message and ran the following script:
which displays the text in the first field. Just as an example, I also executed this:
which copies the selected text from the first field to the end of the second field.
What do you need exactly?
Kind regards,
Mark
Please don't use htmlText for this task. You're dealing with unicode, so use the unicode properties and functions. I selected and copied the sample text from your first message and ran the following script:
Code: Select all
on mouseUp
put the clipboarddata["unicode"] into myVar
set the unicodeText of fld 1 to myVar
end mouseUp
Code: Select all
on mouseUp
if the selectedtext of fld 1 is not empty then
put the unicodeText of the selectedChunk into myVar
set the unicodeText of fld 2 to the unicodeText of fld 2 & myVar
end if
end mouseUp
What do you need exactly?
Kind 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