Re: format of text in resulting text file
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