Re: Convert first char to lower case
Re: Convert first char to lower case
- Subject: Re: Convert first char to lower case
- From: has <email@hidden>
- Date: Wed, 9 Jan 2002 11:50:17 +0000
Steven Angier wrote:
>
I think it is important to note that there are actually 55 characters in
>
the Mac character
>
set whose case should be toggled.
Actually, this is only true for MacRoman (the default set). If you're using
other character sets then it may be different: only characters below ASCII
number 128 are constant - above that it varies from set to set. For
example, Turkish has a dozen extra accented characters on top of what's
already there. Other sets may replace MacRoman's existing accented
characters with something completely different.
Bear this in mind if you intend to distribute the script worldwide - even
if you don't try to support additional character sets, remember to say in
the documentation which character set(s) is/are supported. You might also
consider designing and commenting your code so that users can easily
customise it for their own character sets if they need to. If you're really
dedicated, you could even ask them for feedback so that you can include
multi-language support in a future release.
OTOH, if you know that the only characters that will ever go through your
routine are standard ASCII (0-127), then there's no real need to support
anything beyond that anyway. As always, much depends on what the routine is
being used for.
>
BTW, TID-based lookups are dramatically faster than "offset of" and
>
"ASCII number" calls to scripting additions, but they are a bit of a hack.
I wouldn't call it a 'hack' - imo that's gives the wrong impression. It's
all perfectly standard code doing it's perfectly standard thing. It's a
more complex/advanced technique than using simple osaxen calls, but if you
need speed/more flexibility it's a worthwhile tradeoff.
Cheers,
has