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

Developer

resources

Creating string resources

A string resource element is an array of characters, which can be Unicode, ISOLATIN1, UTF-8, KSC5601, S-JIS, GB2312, or CP949. Unicode is the default. By storing all the character strings that an applet uses in a resource file, you can easily localize the applet for different countries. Data for the string resource can be specified in either hex or text format, or pulled in from a file.

To create string resources

  1. From the Resource Manager GUI, click Insert > New String, or press Shift+Ctrl+S.

    The new string resource properties are displayed in the properties control panel.

  2. Make entries in the following fields.
    Field Make this entry
    ID A number between 1001 and 5000 is assigned automatically; however, it can be changed if you want a specific ID assigned. The ID must be a unique integer among string resources within the same resource file (CAR).
    Name The name must be an array of contiguous characters (no spaces between characters) that is valid for variable names in C/C++.

    Note: Name strings are not saved in the binary BAR file when compiled. When a BAR file is decompiled into CAR format, all Name fields are automatically generated.

    Comment Enter any comments for the resource.

    Note: Comment strings are not saved in the binary BAR file when compiled. Thus, if a particular BAR file is decompiled back into a CAR format, all comment fields will be blank.

    Source Select one of the following formats to specify the type of source for the resource from the drop-down list.
    • Text (default) : The data is in a text format.
    • File: Specifies the data is contained in a file. Currently only disk files are supported.
    • Hex: The data is in hexadecimal format.
    Filename The filename field becomes active when you select file in the Source field drop-down menu. Select Browse to navigate to the location of the desired file. A default name is provided for the resource. The name must be an array of contiguous characters (no spaces between characters) that is valid for variable names in C/C++.

    Note: Name strings are not saved in the binary BAR file when it is compiled. Thus, if a particular BAR file is decompiled back into a CAR format, all Name fields are automatically generated.

    Encoding Select the string encoding format from the drop-down list.

    Note: When KSC5601 is specified as the encoding format and the file is saved, CP949 is subsequently shown as the encoding format. This is because CP949 is a superset of KSC5601.

    Note: For Text source data, the data is encoded prior to compiling the binary BAR file. A Brew MP specific BOM is inserted before the data portion in the BAR file. For File and Hex source data, no encoding is performed, but the BOM is inserted as well.

  3. When you finish entering the string resource properties, click Save.

    The Resource Manager performs data validation on the information and then updates the resource information in the list view.