Text encoding

From Boktai Hacking Wiki
Revision as of 11:04, 4 August 2024 by Raphi (talk | contribs) (Created page with "Text is stored uncompressed in the Script directory. Each character is encoded as either 1 or 2 bytes. * 1 byte: Used for ASCII characters with a code <= 127 (but there are a few exceptions where some ASCII codes have been replaced, see the encoding tables below). * 2 bytes: Used for special characters (e.g. arrows) and for non-English characters (e.g. Japanese). The 1st byte will be between 0x80 and 0x85. In other words, if the top bit of a byte is set, that means...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Text is stored uncompressed in the Script directory. Each character is encoded as either 1 or 2 bytes.

  • 1 byte: Used for ASCII characters with a code <= 127 (but there are a few exceptions where some ASCII codes have been replaced, see the encoding tables below).
  • 2 bytes: Used for special characters (e.g. arrows) and for non-English characters (e.g. Japanese). The 1st byte will be between 0x80 and 0x85.

In other words, if the top bit of a byte is set, that means it's the 1st byte of a 2-byte character. Otherwise, it's a 1-byte ASCII character.

Example: 0x41, 0x80, 0x25 encodes the two characters A★ in Boktai 1 (U).

Encoding tables