[Pythonmac-SIG] Read Strings from Resources

Jack Jansen Jack.Jansen at cwi.nl
Wed Dec 22 10:51:46 CET 2004


On 22 Dec 2004, at 00:22, Opstad, Dave wrote:

>> 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.

Ah yes. And now that I see this I seem to remember that the pstrings 
are padded to a 2-byte boundary.
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman



More information about the Pythonmac-SIG mailing list