• 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: Standard Additions 'read' command - basic questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Standard Additions 'read' command - basic questions


  • Subject: Re: Standard Additions 'read' command - basic questions
  • From: Christopher Nebel <email@hidden>
  • Date: Mon, 19 Jan 2004 12:36:25 -0800

On Jan 19, 2004, at 6:22 AM, Emmanuel wrote:

At 8:46 AM +0100 19/01/04, Emmanuel wrote:
-----------------
set f to "" & (path to "temp") & "(make new name)"
open for access file f with write permission
write "hello" & (ASCII character of 254) & "world" to file f
close access file f
read f using delimiter (ASCII character of 254)
-- {"hello", "world"}
-----------------

(that was under 10.2.8)

As CS emphasizes, this is broken under Panther, whence Chap's question that I did not understand.

I wonder what is the rule which says which characters work as a delimiter and which don't. I tried 250, 253, 254 and 255, they don't work. LF works (great delight!).

Yes, this is broken in Panther, and it broke because of a fix to handle delimiters when reading "as Unicode text". The problem is that your delimiter string is being fetched as Unicode, but then it looks for the Unicode code point in the data, which is *not* 254 (or 255, or whatever), since your primary encoding is probably MacRoman, which doesn't agree with Unicode at all above 127. (127 and below -- that is, ASCII -- is fine.)

I'll file a bug, but in the meantime, try using FS (field separator, ASCII character 28) and RS (record separator, ASCII character 30) instead -- that's what they were designed for.


--Chris Nebel
AppleScript Engineering
_______________________________________________
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.

  • Follow-Ups:
    • ASCII vs. MacRoman (was Re: Standard Additions 'read' command - basic questions)
      • From: Chris Page <email@hidden>
References: 
 >Standard Additions 'read' command - basic questions (From: Chap Harrison <email@hidden>)
 >Re: Standard Additions 'read' command - basic questions (From: Emmanuel <email@hidden>)
 >Re: Standard Additions 'read' command - basic questions (From: Emmanuel <email@hidden>)

  • Prev by Date: Re: String searching
  • Next by Date: Re: Entourage: Obtaining items where the item's every category is contained in a list
  • Previous by thread: Re: Standard Additions 'read' command - basic questions
  • Next by thread: ASCII vs. MacRoman (was Re: Standard Additions 'read' command - basic questions)
  • Index(es):
    • Date
    • Thread