[comp.sys.mac.programmer] UprString problem.

earleh@eleazar.dartmouth.edu (Earle R. Horton) (11/28/89)

     I am trying to build character case translation tables for a
single-byte character set using UprString().  I build a character
array with all 255 non-NUL values in it, then pass it to UprString().
I want UprString() to convert all alphabetic characters to upper case,
while leaving non-alphabetic characters alone.  Based on the result of
this operation, I then build upper to lower and lower to upper
character translation tables.  I also use the information to determine
whether a given character is a letter and not punctuation.  If the
case of a character can be changed, then it is obviously not
punctuation.
 
     Everything works fine, except that UprString() converts '`'
(back-quote) to lower case 'a'.  This happens with System 5.0, System
6.0.3, and System D1-6.0.3 (Deutsch).  I have tried it on a Mac Plus
and on a Mac II.  Always, '`' -> 'a'.  Most distressing.

     I could use Transliterate() or LwrText() to build the same
tables, but these are not available on all Macs and I want this
particular code to be as compatible as possible.

     Is this a bug in UprString()?  What should I do?  I suppose I
could write code to detect the inconsistency and attempt to correct
it...  Are there any other bugs in this routine which manifest on
systems other than U.S. and Deutsch?

Earle R. Horton

svc@well.UUCP (Leonard Rosenthol) (11/30/89)

In article <17296@dartvax.Dartmouth.EDU> earleh@eleazar.dartmouth.edu (Earle R.
Horton) writes:
>
> [trying to build translation tables]
>
>     Everything works fine, except that UprString() converts '`'
>(back-quote) to lower case 'a'.  This happens with System 5.0, System
>6.0.3, and System D1-6.0.3 (Deutsch).  I have tried it on a Mac Plus
>and on a Mac II.  Always, '`' -> 'a'.  Most distressing.
>
>     I could use Transliterate() or LwrText() to build the same
>tables, but these are not available on all Macs and I want this
>particular code to be as compatible as possible.
>

        Actually Transliterate has the same problem, which we also were 
fortunate(?) to discover this week why trying to determine why you couldn't
do a Wait for Text '`' in MicroPhone II...We use Transliterate for our upper
casing (if it exists on the machine, otherwise we use UprString) and found 
the same problem '`' -> 'a' as well.. (Also happens with 6.0.4 US and Swedish
if it makes you feel any better (on Mac II's, SE/30's, etc.)).
        We have sent mail to MacDTS on this one, but have yet to recieve an
answer...I'll give them a couple of days and them go over their heads to get
the answer...It should be a good one ;-)

-- 
+--------------------------------------------------+
Leonard Rosenthol        |  GEnie : MACgician
Lazerware, inc.          |  MacNet: MACgician
UUCP: svc@well.UUCP      |  ALink : D0025

earleh@eleazar.dartmouth.edu (Earle R. Horton) (11/30/89)

In article <14765@well.UUCP> svc@well.UUCP (Leonard Rosenthol) writes:
>In article <17296@dartvax.Dartmouth.EDU> earleh@eleazar.dartmouth.edu
	(Earle R. Horton) writes:
>>
>> [trying to build translation tables]
>>
>>     Everything works fine, except that UprString() converts '`'
>>(back-quote) to lower case 'a'.
...
>        Actually Transliterate has the same problem, which we also were 
>fortunate(?) to discover this week why trying to determine why you couldn't
>do a Wait for Text '`' in MicroPhone II...We use Transliterate for our upper
>casing (if it exists on the machine, otherwise we use UprString) and found 
>the same problem '`' -> 'a' as well.. (Also happens with 6.0.4 US and Swedish
>if it makes you feel any better (on Mac II's, SE/30's, etc.)).

     LwrText seems to be OK.  At least it works correctly on U.S. and
Deutsch systems I have, including doing '`' properly.  LwrText is new,
however, and I think you need System 6.0 for it to work.  (One can use
LwrText to generate a table for upper casing.)  I decided to include a
mechanism to allow users to override entries in the translation tables
I generate, anyway.  I found that even something as basic as an
"ess-tset" (Deutsch double-s as in "Strassburg") doesn't count for a
letter unless you have 6.0.4 and use the Script Manager.  I also
included a search for the anomalous triplet, '`' -> 'a' -> 'A', and
demote the '`' to punctuation if found.

Earle R. Horton