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

Developer

resources

EncStringRscData

This is a helper function that can be used to encode a string. For example, the following ModRsc primitive encodes a string:

data = EncStringRscData(AEE_ENC_UNICODE, "User Mode App")

EncStringRscData takes an encoding type specifier followed by the string to be compiled. The encoding type should correspond to one of the values specified in AEEEncodingTypes.h, which you must include if you intend to use a friendly name for the encoding type, as shown above. The string must be a "clean" string of one of the following 8-bit encoding types, where the encoding determines the desired output string.

Encoding type String data contains:
AEE_ENC_UTF8 = 0x2 A UTF-8 string, compiled as-is.

AEE_ENC_ISOLATIN1 = 0x3

An ISOLATIN string, compiled as-is.

OEM_RAW_TEXT = 0xFA

An 8-bit OEM-specific text data, compiled as-is.

AEE_ENC_EUC_CN = 0xFC

EUC-CN multi-byte encoded string, compiled as-is.

AEE_ENC_S_JIS = 0xFD

Shift-JIS multi-byte encoded string, compiled as-is.

AEE_ENC_EUC_KR/ AEE_ENC_KSC5601 = 0xFE

EUC-KR/KSC-5601 multi-byte encoded string, compiled as-is.

AEE_ENC_UNICODE = 0xFF

A UTF-8 string, converted to UTF-16 when compiled.

Note: Due to the 8-bit requirement of CIF files, note that the AEE_ENC_UNICODE type requires a UTF-8 input string that will be converted to a UTF-16 string in the compiled output. Input files of UTF-16 or other "wide" encodings are not supported by CIFC.

Example

Include "MyResource.h"
include "AEEEncodingTypes.h." -- Need to include to use AEE_ENC_XXX for data.
include "AEEResType.h" -- Need to include to use RESTYPE_XXX for type.
ModRsc {
id = IDS_MyString,
type = RESTYPE_ENCSTRING,
data = EncStringRscData(AEE_ENC_UNICODE, "my string"),
}