Re: strings and strings (was Don't get it.)
Re: strings and strings (was Don't get it.)
- Subject: Re: strings and strings (was Don't get it.)
- From: Emmanuel <email@hidden>
- Date: Thu, 14 Dec 2006 12:29:53 +0100
At 11:40 AM +0100 12/14/06, Peter Waibel wrote:
I've forgotten the details, but IIRC a string can contain 'pure' characters,
or also additional formatting information. You can't see what you're dealing
with by just looking at the class. Usually the latter is the problem: people
use a trick of coercing to list and then coerce the first list item back to
string again, to drop the extraneous information. How to manipulate things in
the other direction in 'vanilla' AS I don't know.
Somewhere I found the handler "AsText".
As far as I know this handler is from Arthur Knapp.
on AsText(str)
--coerce Unicode or other text to styled string to plain text
try
return (((str as string) as record)'s «class ktxt»)
end try
return str -- if plain text to begin with
end AsText
The result of AsText is a pure 8 bit string.
We describe at
<http://www.satimage-software.com/en/unicode_and_applescript.html>
that this popular solution doesn't always work.
However most of the time it's all right for us Western Europeans,
Americans or Aussies.
Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden