Half character on a Mac

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Half character on a Mac

Post by andyh1234 » Wed Nov 18, 2009 3:31 pm

Any ideas on this one.

I can use numtochar(189) in Windows to get a 1/2 character into the text, but on a mac it displays the pie symbol.

I cannot for the life of me find the char map for a 1/2 symbol on the mac, it just doesnt seem to be there, any ideas?

The fonts in use are Arial on Windows and Lucida Grande on the mac.

Thanks

Andy

ibe
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 61
Joined: Sun Oct 04, 2009 12:15 pm

Post by ibe » Thu Nov 19, 2009 6:26 am

The 1/2 character is 0xC2BD in UTF and 0xBD in unicode on a mac. The quickest way I can think of it to display is to do this:
set the useUnicode to true // local variable so don't worry about resetting it
put NumToChar(0xBD) into tTmp
set the text of field "YourField" to yourString & uniDecode(tTmp)

Can probably be done easier but I'm still getting acquainted with RR.

Shows the 1/2 character on my mac.

Ismo

andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Post by andyh1234 » Thu Nov 19, 2009 9:37 am

Thanks Ismo,

That works perfectly in a new empty stack, but still returns the pie symbol in my app so it must be something else somewhere in the stack that is causing the problem, so Im off to find a needle in the haystack!

Thanks for the suggestion, when (or if) I find what is causing the problem Ill report back!

Andy

andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Post by andyh1234 » Thu Nov 19, 2009 10:05 am

Got it at last.

I was using ..

put yourString & uniDecode(tTmp) into "YourField"

Works fine if I use (per Ismos post)..

set the text of field "YourField" to yourString & uniDecode(tTmp)

I guess I should use set instead of 'put' more, which is a shame as Ive used 'put' all over the app!

ibe
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 61
Joined: Sun Oct 04, 2009 12:15 pm

Post by ibe » Thu Nov 19, 2009 1:44 pm

Both ways work for me, except that
put yourString & uniDecode(tTmp) into "YourField"
doesn't compile if I don't add the 'field' keyword:
put yourString & uniDecode(tTmp) into field "YourField"

Might want to check if there is something wrong with your put statement.

Ismo

Post Reply