When LightWave Server copies "string" fields between the JSON message elements and the server IPM it assumes that the data is stored in the IPM using the default server encoding which is ISO-8859-1 encoding. The encoding used can be altered on the element, the API, or set at SERVER process startup.

  • To set the encoding for an individual element, set the encoding attribute on the element.
  • To set the default encoding on all string elements used by an API method, set the encoding on the method in the API editor.
  • To set the default encoding for all services on a specific SERVER instance set the --default-encoding startup option to the desired encoding.

 For example, a request or response containing the following schema structure:

<type name="Request">
    <element name="string_SHIFT_JIS" type="string" offset="0" size="32" encoding="SHIFT_JIS"/>

Would be serialized or deserialized using the SHIFT_JIS encoding, producing the following JSON and IPM data:

  "string_SHIFT_JIS": "ぐけげこごさざしじすずせぜそぞた"

0x00000000: 82ae 82af 82b0 82b1 82b2 82b3 82b4 82b5  00000000: ................
0x00000010: 82b6 82b7 82b8 82b9 82ba 82bb 82bc 82bd  00000016: ................

The value of the encoding attribute or the --default-encoding startup option can be any one of the Character Encoding Names values. Note that LightWave Server always uses UTF-8 encoding for the message payload. Refer to Character Encoding Names for a complete list of the available character encoding names.

  • No labels

LightWave Server 1.1.5