Page 1 of 1

Unicode Bug ?

Posted: Fri Mar 20, 2015 1:11 pm
by trevix
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

Re: Unicode Bug ?

Posted: Fri Mar 20, 2015 2:32 pm
by dunbarx
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

Re: Unicode Bug ?

Posted: Fri Mar 20, 2015 4:34 pm
by FourthWorld
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.

Re: Unicode Bug ?

Posted: Fri Mar 20, 2015 5:53 pm
by trevix
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

Re: Unicode Bug ?

Posted: Fri Mar 20, 2015 6:15 pm
by dunbarx
Hmmm. OK.

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

Craig