Re: Bad Characters
Re: Bad Characters
- Subject: Re: Bad Characters
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 16 Oct 2008 10:27:50 -0400
Hm. something odd about that test - putting the characters into a list
changes the result. If I put the codes into a list and create the
characters with "character id" later, my results agree with Luther's.
Here:
set controlCodes to {}
repeat with cc from 0 to 31
set end of controlCodes to cc
end repeat
repeat with cc from 127 to 159
set end of controlCodes to cc
end repeat
set emptyList to {}
repeat with controlCode in controlCodes
set charCode to controlCode as integer
set testChar to character id charCode
if testChar = "" then
set end of emptyList to charCode
end if
end repeat
emptyList
-- { et controlCodes to {}
repeat with cc from 0 to 31
set end of controlCodes to cc
end repeat
repeat with cc from 127 to 159
set end of controlCodes to cc
end repeat
set emptyList to {}
repeat with controlCode in controlCodes
set charCode to controlCode as integer
set testChar to character id charCode
if testChar = "" then
set end of emptyList to charCode
end if
end repeat
emptyList
-- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 127, 128, 129, 130, 131, 132, 134,
135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159 }
So character id's 9 through 13 - tab through carriage return - don't
test as empty; neither does character 133 (ISO 2022 "Next Line"
character). Other than that, control characters test as the empty
string. I'd call that a bug all right.
_______________________________________________
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