generate_header: fix handling of escape sequences

The string in the source file can be C-escaped. We can copy them
directly as-is in the catcomp block (the C compiler will then handle the
escapements), but we have to adjust the length to be the one after the
escapements are processed.
1 file changed
tree: d465b66e6e492d8b779ef2fa28f62940a23d6456
  1. .gitignore
  2. AmigaCatalog.cpp
  3. AmigaCatalog.h
  5. Makefile

Amiga applications use a locale catalog format based on IFF. It is fairly simple:

  • type: CTLG

  • chunks: FVER, LANG, CSET, STRS

  • FVER: the standard version chunk; contain the version of the app to be localized

  • LANG: holds a string which is the name of the target language

  • CSET: I don't know what this is, apparently unused.

  • STRS: the translated strings. The format is 2 DWORDs followed by the string data. The first dword is the string ID, the second is the length. Each string is padded so each entry in the table starts on a DWORD boundary.

String lookup is done by ID only, unlike the Haiku native catalog formats which does lookup by strings instead. This is faster as there is no need to hash the source string, and no possibility of hash collision.

This project is distributed under the terms of the MIT license.