• 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: Unicode text and the annoying relic called "styled text"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode text and the annoying relic called "styled text"


  • Subject: Re: Unicode text and the annoying relic called "styled text"
  • From: jj <email@hidden>
  • Date: Wed, 22 Dec 2004 20:23:03 +0100

>>> Here's the version I use, as first discovered/invented by Arthur Knapp:
>>>
>>> on AsText(str)
>>>     --coerce Unicode or other text to styled string to plain text
>>>     try
>>>         return (text of ((str as string) as record)) as string
>>>     end try
>>>     return str as string -- if plain text to begin with, or real Unicode
>>> end AsText
>>
>> Here is my Arthur's version:
>>
>> on AsPlainText(textual) --> Arthur Knapp
>>     --
>>     -- Where 'textual' values may include plain text,
>>     -- 'international text', styled text, Pascal string,
>>     -- C string, Unicode text, and =ABclass utf8=BB.
>>     --
>>     -- Unicode characters not having a single-byte
>>     -- "mapping" come back as a question mark.
>>     --
>>     set {text:plainText} to textual as text
>>     return plainText
>> end AsPlainText
>
> Yeah, I've got that (later) version too. I don't quite understand it yet.
> ;-) I'm not sure if it's meant to be better (more versatile), or just
> shorter. Are there any cases where the first version won't work and the
> second will?
>
> --
> Paul Berkowitz

Being Arthur's code, most probably the recent version is faster than the old
one, perhaps 10 ticks every 1000 runs. ;-)


jj

--
http://www.macscripter.net/
http://www.osaxen.com/


 _______________________________________________
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

References: 
 >Re: Unicode text and the annoying relic called "styled text" (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Unicode text and the annoying relic called "styled text"
  • Next by Date: Re: Unicode text and the annoying relic called "styled text"
  • Previous by thread: Re: Unicode text and the annoying relic called "styled text"
  • Next by thread: Re: Unicode text and the annoying relic called "styled text"
  • Index(es):
    • Date
    • Thread