How can i display greek characters.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
panosdk
Posts: 14
Joined: Mon Jul 22, 2013 10:34 am

How can i display greek characters.

Post by panosdk » Sun Aug 04, 2013 9:39 pm

Well sorry for asking again but i cannot seem to figure this one out. I want to display greek characters into my stack. Greek characters appear normal in the stack. But when i try to display characters through code into an answer or a label i get question marks. As you can see in the attached picture, the button of stack has greek characters displaying ok. But the label box has question marks. Even the code editor after i close and open it again has question marks.
Attachments
greek-livecode.PNG

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: How can i display greek characters.

Post by Simon » Sun Aug 04, 2013 9:58 pm

Hi again panosdk,
The attached stack is taken from step 7 of the lesson I mentioned earlier.

I get why you may be having troubles with this, it's not very apparent that you have to put the text into a fld first.
But it does work (slightly odd).

Simon
Attachments
answer_greek.zip
LC 6.1
(624 Bytes) Downloaded 261 times
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

panosdk
Posts: 14
Joined: Mon Jul 22, 2013 10:34 am

Re: How can i display greek characters.

Post by panosdk » Mon Aug 05, 2013 12:39 am

Thank you.I got it.Thanks for your example simon.
What if i just want to display a greek string.
for example

put "greek string" into somevar
answer somevar

The example you showed me gets the htmltext of a string in a text field.How can i do the same thing with just a variable and no textfield.
Have a nice day

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: How can i display greek characters.

Post by Simon » Mon Aug 05, 2013 6:50 am

Hi panosdk,
You should look up "useUnicode" and "charToNum/numToChar" in the dictionary.
I think you'll have to store your text as numeric values.
e.g. put "917 943 956 945 953 32 963 964 945 32 949 955 955 951 957 953 954 940" into someVar (that is the greek string that was in the stack I posted).
For "answer..." you would have to do a numToChar into a (hidden?) field and do the htmlText thing again.

I could be wrong and maybe someone will correct me. Does seem like an awful lot of work.

Simon
EDIT: might be simpler to save the htmlText, again this uses a field for "answer..."
"put the htmlText of fld 1 into gGreek" now the info is stored in a var. (it's a field again for the translation into html but now you can save it anywhere).
You could use:

Code: Select all

put "<p><font face="Segoe UI" size="12">&Epsilon;&#943;&mu;&alpha;&iota;</font> <font face="Segoe UI" size="12">&sigma;&tau;&alpha;</font> <font face="Segoe UI" size="12">&epsilon;&lambda;&lambda;&eta;&nu;&iota;&kappa;&#940;</font></p>" into gGreek
then:
"set the htmlText of fld 2 to gGreek" -- put it into a fld for the "answer..."

EDIT 2:
From the lessons there is no other way to get Greek into the ask/answer dialog but to use a field.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

panosdk
Posts: 14
Joined: Mon Jul 22, 2013 10:34 am

Re: How can i display greek characters.

Post by panosdk » Mon Aug 05, 2013 12:01 pm

I used a hidden textfield.I wish this thing will get fixed somehow.Thanks

Post Reply