IiopSetWCharType Function

Action

Determines how Silk Performer interprets wide characters. By default, wide characters as regarded to be Unicode.

Include file

IIOP.bdh

Syntax

IiopSetWCharType( in nCharType : number,
                  in nCharSize : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
nCharType

Determines the type of wide characters. This parameter can be one or more of the following:

  • IIOP_BYTE_ORIENTED. Wide characters are of different size and bytes are not swapped for transmission.

  • IIOP_WIDE_LITTLE_ENDIAN. Wide characters are of fixed size and are represented in little-endian byte order. Bytes are swapped depending on the byte order used for transmission.

  • IIOP_WIDE_BIG_ENDIAN. Wide characters are of fixed size and are represented in big-endian byte order. Bytes are swapped depending on the byte order used for transmission.

  • IIOP_WIDE_NO_LENGTH_ENCODED. With IIOP 1.2 the wchar encoding contains a length indication. When this flag is used, wchars are encoded without the length encoding.

  • IOP_WIDE_NULL_TERMINATED. With IIOP 1.2 wstrings are not null-terminated. When this setting is used, wstrings are null-terminated as in prior IIOP versions.

  • IIOP_WIDE_LENGTH_IN_WCHAR. With IIOP 1.2 the length of a wstring is measured in bytes (chars). When this setting is used, the length of a wstring is counted in wchars as in prior IIOP versions.

  • IIOP_WIDE_BYTE_ORIENTED. The same as IIOP_BYTE_ORIENTED.

nCharSize Specifies the size of a wide character for the character types IIOP_WIDE_LITTLE_ENDIAN and IIOP_WIDE_BIG_ENDIAN (optional). The size must be 1, 2, or 4.

Example

var
  hIiop: number;

dcltrans
  transaction TMain
  begin
    // use the big endian representation
    IiopSetWCharType(IIOP_WIDE_BIG_ENDIAN, 2);
    IiopSetWString(hIiop, "\x004d00610072006b00750073", 12);
    // use the little endian representation
    IiopSetWCharType(IIOP_WIDE_LITTLE_ENDIAN, 2);
    IiopSetWString(hIiop, "\x4d00610072006b0075007300", 12);
    // alternatively, use the IiopSetString function
    IiopSetString(hIiop, "Markus", IIOP_USE_WCHAR);
  end TMain;