WL#12370: Extend the UDF API to handle properly character sets of the arguments and the return value

Affects: Server-8.0   —   Status: Complete

Currently the UDF API doesn't really handle character sets properly.

There are following two problems :

1. The String UDF expected to return a "char *" encoded into the character
   set of the return argument (as declared in CREATE FUNCTION ... SONAME).
   But the UDF doesn't really know what character set of the return value is.

2. The string arguments are expected to receive a "char *" encoded in character
   set perceived by the server but the UDF doesn't really know what is
   character set of arguments. So currently there's no guarantee that anything
   but US ASCII can be handled reliably and predictably as a string argument.

Aim of this worklog is to address above two problems with the UDF as following:

1. UDF should be able to specify the character set of the returning "char *".
   UDF() should be able convert the return value in the specified character
   set. UDF() may use string component services for converting the return value
   into the charset specified.

2. UDF should be able to know the character set name of each argument as
   determined by the server.