Re: "read from" and non-lo-ascii characters
Re: "read from" and non-lo-ascii characters
- Subject: Re: "read from" and non-lo-ascii characters
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 20 Jun 2005 16:35:01 -0700
- Thread-topic: "read from" and non-lo-ascii characters
On 6/20/05 4:21 PM, "Christopher Nebel" <email@hidden> wrote:
> On Jun 20, 2005, at 1:36 PM, jj wrote:
>
>>> When I tried to read the file using "until" or "before" I found
>>> that they
>>> didn't work with those characters. Reading until or before "e" or
>>> "i" worked
>>> fine, but not until or before option-1 or option-2. Text encodings
>>> were fine
>>> (MacRoman was being used throughout, and when I read the whole
>>> file, the
>>> characters in question came in perfectly), so I can only conclude
>>> that
>>> reading "until" or "before" is just plain broken in case the
>>> character being
>>> used is not lo-ascii.
>>
>> Seems a bug. I tried encoding a file as Unicode text, then reading
>> until
>> "blah" as Unicode text. Seems that it recognizes the delimiters,
>> but it will
>> skip some characters... So, more bugs...
>
> matt's problem is indeed a bug. It broke in Panther, in an attempt
> to improve the behavior of reading UTF-16 files using delimiters; to
> my knowledge, no one has reported it before. If you use a UTF-16
> file, however -- add "as Unicode text" to the appropriate "read" and
> "write" commands -- it should work.
>
> As for jj's complaint, realize that the "before" and "until"
> delimiters are defined to only be a single character. If you specify
> a longer string, it will merely use the first character.
As a workaround for the time being, I'd suggest to Matt using a <32 low
ASCII character: I use ASCII 31. It never occurs in regular text so works
well as a delimiter. Don't use it with binary data - list, record, date -
but you don't need to, as Chris has pointed out to me before. If you read
and write 'as list' or 'as record', they are "self-defining": reading back
'as list' and 'as record' finds the perfect item without need for a
delimiter. Using delimiters with dates was broken before Tiger (fixed now)
but just 'read for 8 as date' works since dates are always 6 bytes.
--
Paul Berkowitz
_______________________________________________
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