STRG (Metroid Prime 3)

See STRG (File Format) for the other revisions of this format.

The STRG format in Metroid Prime 3 is another update to the STRG format, used both in Prime 3 as well as Donkey Kong Country Returns. The most significant change from the Echoes STRG format is that the string encoding was changed from UTF-16 to UTF-8. There was also a more robust system for string offsets implemented, allowing for the same string of text to be reused for multiple languages if the string is identical in both.

Format
The header should be familiar to you if you've worked with the Prime 1/2 STRG format in the past. It remains unchanged.

String Names
The next part of the file is a table that allows names to be assigned to strings. It's identical to the name table structure from Echoes.

Each entry is structured as follows:

After every name entry comes all the names in the form of a large UTF-8 string array. The names are zero-terminated, and they're sorted in alphabetical order; the sorting is case-sensitive, so 'Z' will appear before 'a'.

Languages
Next is a segment that defines which languages are included by the file and where their strings are. This section of the file starts with one fourCC for each supported language. Then this small structure repeats per language:

Strings
Finally, the actual string data. Each string is composed of a 32-bit size followed by UTF-8 Unicode string data.