Re: What to do when strings don't match but should?
Re: What to do when strings don't match but should?
- Subject: Re: What to do when strings don't match but should?
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 14 Mar 2004 09:49:59 -0800
Unicode characters have two bytes. In the case of ASCII characters - and
most other European characters - the first byte is ASCII character 0. In
AppleScript 1.9.2 and 1.9.3 - and I'm not sure how much further back but not
too far - AppleScript itself will see the Unicode and non-Unicode versions
as 'equal': a coercion is involved. (It was a conscious decision, and I
think a good one, not to stick to the rigid interpretation of 'equals' for
ASCII-Unicode correspondence. That was not so a few AS versions back. And,
IIRC, 'starts with' remained different until very, very recently.)
In the case of your 'application result', is it one that requires 'as
Unicode text' or does it appear naturally as Unicode? In the case of the
text file, are you certain the text is plain string, or does it need to be
read 'as Unicode text' itself?
And which OS/AS version are you using?
Don't forget that if you try to get 'ASCII number of character x',
AppleScript will look at the separate bytes of Unicode text since there's
actually no such thing as an ASCII number of a Unicode character.
--
Paul Berkowitz
>
From: Jason Bourque <email@hidden>
>
Date: Sun, 14 Mar 2004 12:29:50 -0500
>
To: Jason Bourque <email@hidden>
>
Cc: AppleScript ML 2 <email@hidden>
>
Subject: Re: What to do when strings don't match but should?
>
>
Well, every other character is ASCII character 0
>
>
Why is that? Where did they come from?
>
>
Jason
>
>
>
On Sunday, March 14, 2004, at 11:32AM, Jason Bourque <email@hidden>
>
wrote:
>
>
> Hello,
>
>
>
> I have two strings. One I read from a text file and another from a result
>
> from an Application (I think is unicode text).
>
>
>
> Now in script debugger they look the same. But equals, starts with, always
>
> come up false.
>
>
>
> What do I do, I know there the same?
>
>
>
> Jason Bourque
>
> _______________________________________________
>
> applescript-users mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/applescript-users
>
> Do not post admin requests to the list. They will be ignored.
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.