Re: Bad Characters from Unicode
Re: Bad Characters from Unicode
- Subject: Re: Bad Characters from Unicode
- From: "Gary (Lists)" <email@hidden>
- Date: Sun, 30 Sep 2007 16:14:00 -0400
- Thread-topic: Bad Characters from Unicode
"Luther Fuller" wrote:
>> But if you leave off the "as unicode text" in the assignment, then
>> it's NOT unicode, so I don't see how even the qualified question
>> applies here...
>
> Which, I think, identifies another problem. The script where I first
> encountered a problem has over 1600 lines of code. It's big. If I am
> going to use Unicode text in this script (and I don't), then I need
> some command or statement that will insure that every text string is
> Unicode without having to remember to put "as Unicode text" after it.
> Currently the default for text is 'ascii text' unless "as Unicode
> text" is declared. It's very easy to omit that detail and very hard
> to find the omission once it's made. It's the sort of error that
> takes days to find.
Maybe you'll need to implement your own U() wrapper. (In Drupal development
(PHP), we use a 't()' function to specifically process any piece of
translatable text. All strings are set with 't("the string")' for example.)
In the same vein, you could modify your script (and script writing) to call
your own 'as unicode text' handler for each piece of string.
...
set _someUniStringBit to U("hello world") -- use *every time*
...
-- add your handler to every script
--
to U(s) -- make unicode
... maybe handle some potential error-producing bits
return (s as unicode text)
end U
--
Gary
_______________________________________________
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