Re: Stupid, Stupid Text Features [Was: Can't set creator type]
Re: Stupid, Stupid Text Features [Was: Can't set creator type]
- Subject: Re: Stupid, Stupid Text Features [Was: Can't set creator type]
- From: Shane Stanley <email@hidden>
- Date: Wed, 25 Feb 2004 08:51:54 +1100
On Feb 25, 2004, at 12:53 AM, Hanaan Rosenthal wrote:
What I'm irritated by the most is the resurgence of styled text in
statement
results. I get it returned from commands that have nothing to do with
any
style, and I don't know of many commands that require styled text as
param.
"style" is a bit of a misnomer -- it actually contains information
about language encoding. Depending on the language the user has set,
the same byte of "raw" text can represent totally different characters.
Leaving out the encoding info is potentially disastrous. I suspect the
reason there's no simple coercion from styled text is because the
operation is _guaranteed_ to corrupt some data.
Take the example of file types, which aren't really four-letter codes
but four bytes. If (OK, when) display dialog returned raw 8-bit ASCII,
it's quite possible the same character on language systems would end up
setting a different value. That's crazy. It only worked most of the
time because the common characters of the alphabet were used most of
the time. (The real solution here probably involves treating the bytes
as bytes.0
There's no easy way around this. Think of ASCII as a widely used hack
whose time has come. The changeover is going to be painful.
I seem to recall Chris Nebel posted somewhere a while back that
unstyled text might eventually go away altogether. Now that, IMO, would
be the best of solutions.
--
Shane Stanley <email@hidden>
_______________________________________________
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.