Re: path to as string
Re: path to as string
- Subject: Re: path to as string
- From: Doug McNutt <email@hidden>
- Date: Fri, 1 Jul 2005 14:28:08 -0600
At 19:54 +0100 7/1/05, has wrote:
>Mac OS X, as you might have noticed, uses POSIX paths. HFS paths are a Mac OS 9 feature. Their presence in OS X is due to the need to maintain backwards support with older pre-OS X software (such as AppleScript).
I know I could probably look it up bit. . .
Just how is a unicode file or directory name stored in the catalog information in an HFS btree?
And how is the limit on character count determined?
I can imagine a UTF-8 string for which each char - in the C sense of unsigned char - is examined for a sign bit. If it's there the previous two chars are merged into a single unicode character for public distribution.
I can also imagine a UTF16 convention for which the presence of any non ASCII character - in the strict 7 bit sense - forces the entire file name to be stored as 16 bit words. (And what if we go to Intel, will the bytes get reversed?)
Now what is the limit for graphemes in a file name? is it only half as many if some character requires a unicode representation?
It is important that HFS filenames be compatible with earlier uses of HFS. Does that mean that those three bit unicode items are compared as though they were simple C unsigned chars when opened in Classic?
What happens when a sign bit is encountered on an archival CD-ROM with an HFS file system? It presence there implies use of one of those higher than 127 "ASCII" characters. But it can also mean that the previous two chars should be treated as the more significant bits of a UTF-8 code point.
Perhaps an understanding of the way Apple treats the compatibility issues would help in understanding the problems of strings in AppleScript. It's possible that the use of POSIX file paths helps AppleScript because the compatibility issue can be handled in some class structure.
--
--> There are 10 kinds of people: those who understand binary, and those who don't <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden