[Pythonmac-SIG] Read Strings from Resources

Opstad, Dave dave.opstad at monotypeimaging.com
Wed Dec 22 00:22:11 CET 2004


> I've filed a bug report (#1089399), so it'll be fixed, but that's a
> long term thing (not before 2.5). In the short term you'll have to
> parse the STR# resource yourself. I'm not 100% sure, but I think
> they're just a null-byte separated list. If they're something else (a
> list of Pascal strings?) I'll just hope someone will chime in.

According to MacTypes.r (in the last Universal Headers revision), the
Rez format for a 'STR#' resource is as follows:

--------------------
type 'STR#' {
   integer = $$Countof(StringArray);
   array StringArray {
      pstring;   /* String */
   };
};
--------------------

So it looks like a 2-byte count followed by an array of Pascal strings.

Dave Opstad


More information about the Pythonmac-SIG mailing list