Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 5 - Text Utilities / Text Utilities Reference
Routines / Modifying Characters and Diacritical Marks


StripDiacritics

The StripDiacritics procedure strips any diacritical marks from a text string. The text string can be up to 32 KB in length.

PROCEDURE StripDiacritics (textPtr: Ptr; len: Integer;
                           script: ScriptCode);
textPtr
A pointer to the text string to be stripped.
len
The number of bytes in the text string.
script
The script code for the script system whose rules are used for determining which character results from stripping a diacritical mark.
DESCRIPTION
StripDiacritics traverses the characters starting at the address specified by textPtr and continues for the number of characters specified in len. It strips any diacritical marks from the text.

The conversion uses tables in the string-manipulation ('itl2') resource of the script specified by the value of the script parameter. The possible values for script codes are listed in the chapter "Script Manager" of this book. You can specify smSystemScript to use the system script and smCurrentScript to use the script of the current font in the current graphics port.

If StripDiacritics cannot access the specified resource, it generates an error code and does not modify the string. You need to call the ResError function to determine which, if any, error occurred. ResError is described in the Resource Manager chapter of the book Inside Macintosh: More Macintosh Toolbox.

SPECIAL CONSIDERATIONS
StripDiacritics may move memory; your application should not call this procedure at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro for the StripDiacritics procedure is
Trap macro
_StripText

The registers on entry and exit for this routine are
Registers on entry
A0pointer to first character of string
D0length of string in bytes (word); must be less than 32 KB
Registers on exit
D0result code

RESULT CODES
noErr0No error
resNotFound-192Can't get correct 'itl2' resource or resource is not in current format

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996