• 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: format of text in resulting text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: format of text in resulting text file


  • Subject: Re: format of text in resulting text file
  • From: Emmanuel <email@hidden>
  • Date: Mon, 23 Jul 2007 01:43:33 +0200

At 3:59 PM -0700 7/22/07, Michael Warner wrote:
I can successfully right some text to a file.

When I open that file in BBEdit,  and turn on
show invisibles,  I get an upside down ? between each character.

How do I write text to a file such that that does not happen?

When you do: write aString to aFile and aString is Unicode (which is frequent in OSX) you get a UTF-16 file, which means that our usual characters are stored as two bytes: the other being a null byte.


You want either: write aString to aFile as string (which makes Mac-encoded files), or write aString to aFile as «class utf8», which makes UTF-8, which is mostly like PC-encoded files as far as our usual characters are concerned.

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/archives/applescript-users

This email sent to email@hidden
References: 
 >format of text in resulting text file (From: Michael Warner <email@hidden>)

  • Prev by Date: Re: format of text in resulting text file
  • Next by Date: Re: format of text in resulting text file
  • Previous by thread: Re: format of text in resulting text file
  • Next by thread: Re: String Munging
  • Index(es):
    • Date
    • Thread