ADC Home > Reference Library > Technical Q&As > Legacy Documents > Text & Fonts >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Workaround for Converting Lower to Uppercase Characters while Keeping Diacritical Marks

Q Calling UpperString with a single-character string containing a grave-accent (ASCII $60) returns a lower-case 'a' (ASCII $61). Is this supposed to happen?

A This is a bug that was fixed sometime ago, but the fix broke some file-system code that depends on the incorrect translation.

There is a workaround: To convert lowercase characters to uppercase (keeping diacritical marks), use UppercaseText(). To strip diacritical marks while converting from lowercase to uppercase characters, use UppercaseStripDiacritics(). Both of these routines are described in Inside Macintosh:Text on pages 5-67 through 5-70. Both of these calls use tables in the string-manipulation ('itl2') resource to perform their character-mapping operations, which allows you to customize their operation for different countries.

For example, to convert the Pascal string 'myTestStr' to all uppercase, use UppercaseText() in the following way:

        UppercaseText(myTestStr, myTestStr[0],  smSystemScript);

[May 01 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.