Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Device encoding

Device encoding provides information to applications about fonts available on the device, including the format that is used by AECHAR-based _DrawText() functions.

When localizing applications, the following should be taken into consideration:

  • When applications call ISHELL_LoadResString(), STREXPAND(), or STRCOMPRESS():
    • For KSC5601, S_JIS, and EUC_CN, the string encoding must match the device encoding or else the string will not be expanded correctly.
    • The system calls STREXPAND() internally and assumes that the device encoding matches the resource encoding.
    • Converts from well-understood one- or two-byte strings per character encoding into Brew's special one uint16 per character encoding.
  • Data passed to IDisplay_DrawText() or IWidget_SetText() should be in wEncoding format (unless the system fonts have been overridden with something that supports another encoding).
  • IResFile loads a string, determines its encoding, then converts it to AECHAR.

    IResFile does not depend on device encoding.

    IResFile does not support the AEE_RES_LANGDIR and AEE_RES_LANGSUF macros.

To avoid encoded string expansion, applications should do the following:

  • Look at the encoding and language to decide what format text to present to platform DrawText() functions. 
  • Avoid ISHELL_LoadResString(), STREXPAND(), and STRCOMPRESS().
  • Load data (for example, by calling ISHELL_LoadResDataEx()) and use ICharsetConv class to convert to AECHAR.