Although the default encoding for user DLL parameters is UTF-8, it is possible to use System Default Encoding or Unicode instead.  This is less efficient and is therefore not recommended.  All the functions in a single DLL must use the same parameter encoding.

To work with parameters which are encoded using system default encoding, or with Unicode encoding, there are the following differences from the default set-up:

DLL specification

The command to specify a DLL must contain a suffix of A or U on the DLL number, for example:

$load_DLL M1 1A validate.dll  ; DLL_PARM will be passed with system default encoding

$load_DLL M1 2U lookup.dll    ; DLL_PARM will be passed as Unicode

The parameters to a call control DLL will always be passed as UTF-8 encoding.  Since they are usually numeric, the encoding is not significant.

Function calls

When Unicode parameters are used, the prototype for your DLL functions should be:

__declspec(dllexport) int WINAPI TestFunc (int lineno, 

                                           int callno, 

                                           wchar_t * arg)

Access to CopiaFacts variables

The encoding selected for the DLL also affects the encoding for the functions used to get and set CopiaFacts variables, and also the parameters of the DLLInit function.  For system default encoding, there is no change to the standard prototype. For Unicode encoding, the callback functions are prototyped as follows:

typedef void (*FFCB_GVW)(int,wchar_t const*,wchar_t*,int); /* getvar */

typedef void (*FFCB_SVW)(int,wchar_t const*,wchar_t const*); /* setvar */

typedef int (*FFCB_DIW)(int,FFCB_GVW,FFCB_SVW); /* dll init */