• 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 to plain text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode to plain text


  • Subject: Re: Unicode to plain text
  • From: John Delacour <email@hidden>
  • Date: Thu, 19 Sep 2002 23:05:18 +0100

At 3:14 pm -0700 18/9/02, Jon Pugh wrote:

At 12:02 PM -0700 9/18/02, Jon Pugh wrote:
Does anyone know how to convert utxt to TEXT in plain AppleScript?

And the winner is:

At 2:04 PM -0700 9/18/02, John Coelho wrote:
>set plain_text to +class ktxt; of (unicodeString as record)

Unless, of course, it is _true_ Unicode text, in which case it will not be coerced to a record, since it needs to contain no style info. The style info is purely for the purposes of displaying in NON-Unicode fonts in NON-Unicode environments.

One day the message is going to get through!


Try this:


set f to "" & (path to temporary items) & "junk.txt"
open for access file f with write permission
set eof file f to 0
repeat with i in words of "254 255 14 161 14 162 14 163"
write (ASCII character i) to file f
end repeat
close access file f
tell application "TextEdit"
open {alias f}
set uText to get paragraph 1 of document 1
end tell
class of uText --> Unicode text
try
uText as record
on error e
return {uText, e}
end try

-- JD
_______________________________________________
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.

References: 
 >Unicode to plain text (From: Jon Pugh <email@hidden>)
 >Re: Unicode to plain text (From: Jon Pugh <email@hidden>)

  • Prev by Date: Re: Queuing a Eudora message...
  • Next by Date: RE: Summary: OS X running?
  • Previous by thread: Re: Unicode to plain text ( funklessly ) (not)
  • Next by thread: Re: Unicode to plain text
  • Index(es):
    • Date
    • Thread