Peeking at (and Playing with) String Files

Most Mac OS X applications contain internationalized string files, typically named Localization.strings. This file appears in each language-specific lproj folder, and allows developers to internationalize their applications by providing language-specific alternatives for string replacement.

String files generally use UTF-16 (Unicode) encoding, which makes them difficult to view or edit in Terminal. (Some use UTF-8, but that’s less common.) UTF-16 uses extra bits for each alphabetic character, allowing a much wider range of characters to be used. Unicode can handle character sets ranging from French to Norwegian, from Japanese to Finnish, from Korean to Dutch; visit http://www.unicode.org to learn more. The Unicode site lets you view and download character code charts and search through the character database.

Figure 3-10 shows what a Terminal window might look like as you attempt to list the contents of a Localization. strings file. Fortunately, you can easily view and edit string files in TextEdit, which fully supports UTF-16 character encoding.

Localization.strings files use Unicode UTF-16 encoding, making them hard to view or edit using Terminal.

Figure 3-10. Localization.strings files use Unicode UTF-16 encoding, making them hard to view or edit using Terminal.

In the example shown here, more treats each 8-bit ...

Get Modding Mac OS X now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.