Unicode Bug ?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trevix
Posts: 1079
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Unicode Bug ?

Post by trevix » Fri Mar 20, 2015 1:11 pm

I am trying to translate my stacks from LC 5.5.5 to LC 7.0.4 rc 2 on Mavericks.
So many things don't work anymore in my stacks that it's becoming hard for me to tell if it's a LC bug or a problem with my scripts.

Code: Select all

    put the short date into tVar
    set the itemdel to slash
    put char -2 to -1  of item 3 of tVar into msg
This result to nothing (wrong).

But if i do this

Code: Select all

    put the short date into tVar
    set the itemdel to slash
    put item 3 of tVar into tVar
    put char -2 to -1  tVar into msg
I regularly get "15".
Let me tell you: this doesn't help.
Trevix
Trevix
OSX 14.6.1 xCode 15 LC 10 RC1 iOS 15> Android 7>

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Unicode Bug ?

Post by dunbarx » Fri Mar 20, 2015 2:32 pm

There is nothing wrong with either of your two examples. I would think you do not need so much coding:

Code: Select all

  set the itemdel to slash
      answer item 3 of the short date
But that is a matter of style, and oftentimes shorter is not simply better, especially if new functionality is to be inserted into the mix.

But in any case, I get "15" in both handlers, as expected. What are you expecting, and what are you getting? This has nothing to do with unicode, by the way.

Craig Newman

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Unicode Bug ?

Post by FourthWorld » Fri Mar 20, 2015 4:34 pm

Good find, Trevix. I took the liberty of submitting a bug report for this:
http://quality.runrev.com/show_bug.cgi?id=15045

Feel free to add yourself to the CC list there to follow its progress.

I agree with Crag's suggestion that this probably isn't related to Unicode, but given how frequently we use nested chunk expressions I'd like to see this addressed ASAP, and I trust the team will as well now that you've identified this.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

trevix
Posts: 1079
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Re: Unicode Bug ?

Post by trevix » Fri Mar 20, 2015 5:53 pm

Craig:
on the first script on LC5.5.5 tVar= 15
on the first script on LC7.0.4 tVar= empty

The reason I thought of Unicode was because of this line in the dictionary under "char"
Note: In versions prior to 7.0 the byte chunk was identical in functionality to the character chunk. In 7.0 and later a character is not an 8-bit unit and it is therefore not appropriate to use this type of chunk expression on binary data, to refer to 8-bit units in binary data use the byte keyword.
The original script had to handle various short date conversions back and forth between English(mm/dd/yy), Italian(dd/mm/yy), Canadians (yy/mm/dd) formats. In these cases, DateItems would be of no help,since it depends on the original format and the final format. Just to know. (I wish that the useSystemDate were a global property...).

FourthWorld :
Thanks
Trevix
OSX 14.6.1 xCode 15 LC 10 RC1 iOS 15> Android 7>

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Unicode Bug ?

Post by dunbarx » Fri Mar 20, 2015 6:15 pm

Hmmm. OK.

I guess I should not make statements about v.7 while testing in v.6.

Craig

Post Reply