Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!usc!apple!ftanaka From: ftanaka@Apple.COM (Forrest Tanaka) Newsgroups: comp.sys.mac.programmer Subject: Re: upper2lower() Keywords: upper lower case transliterate lowertext uppertext Message-ID: <49283@apple.Apple.COM> Date: 17 Feb 91 19:50:08 GMT References: <1991Feb16.212018.1987@sics.se> Organization: Apple Computer Inc., Cupertino, CA Lines: 40 ollef@sics.se (Olle Furberg) writes: > What's the right way to convert a letter from upper to lower case? >For all letters A-Z, it's very easy. But how do I find the lower case >version of "E" with acute accent? One way to convert a run of text between upper case and lower case is to use the Transliterate routine, documented on pages 311 and 312 of Inside Macintosh V. Starting from system software version 6.0.4, it uses the extended Macintosh character set that all the LaserWriter fonts (Times, Helvetica, etc.) have for Roman text. The character mapping for the extended Macintosh character set define that characters with certain diacriticals must be at the locations that you can see in the LaserWriter fonts, so if you use a font that doesn't use that character mapping, you could get funny results. This routine, as with many other Script Manager routines, checks on the type face of the current GrafPort to determine how to do the conversion. So it uses the extended Macintosh character set mapping if the current GrafPort's type face is Roman, and it uses a different character mapping if the current type face is Cyrillic, for example. Transliterate is a pretty hefty routine, so if you don't want to put up with its bulk, you can convert strings from upper case to lower case using the simpler and faster routine LowerText. It's documented in the Worldwide Software Overview chapter of Inside Macintosh VI, and it's documented as LwrText and LwrString in the Script Manager 2.0 documentation. Starting from system software version 6.0.4, LowerText became localizable because it uses information in the current font script's itl2 to do the conversion. To convert lower case text to upper case, you have to use Transliterate. But with system software version 7.0, you can use the UpperText routine which uses the current font script's itl2 to do the conversion. There was an UprText routine that also did the conversion, but it used hard-coded tables and was not localizable, and I think it used the traditional Macintosh character set instead of the extended one. -- Forrest Tanaka Graphics/Toolbox Developer Technical Support Apple Computer, Inc. AppleLink: TANAKA Internet: ftanaka@apple.com