• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: strings and strings (was Don't get it.)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: strings and strings (was Don't get it.)
      • From: Christopher Nebel <email@hidden>
References: 
 >Don't get it. (From: Todd Geist <email@hidden>)
 >Re: strings and strings (was Don't get it.) (From: Sander Tekelenburg <email@hidden>)
 >Re: strings and strings (was Don't get it.) (From: Peter Waibel <email@hidden>)

  • Prev by Date: Re: CsvToListOfText
  • Next by Date: Re: CsvToListOfText
  • Previous by thread: Re: strings and strings (was Don't get it.)
  • Next by thread: Re: strings and strings (was Don't get it.)
  • Index(es):
    • Date
    • Thread