Do the following (pseudo-code)
create table test (
strfield varchar(30) character set UTF8
SQLDriverConnect( ... CHARSET=UTF8 ...)
SQLPrepareW(hStmt, "insert into test values (?)", SQL_NTS)
SQLBindParameter(hStmt, 1, SQL_PARAM_INPUT, SQL_C_WCHAR, SQL_VARCHAR, 30, 0, str_field, sizeof(str_field), &str_field_len);
with str_field containing min 30 chars, and min. one of them beeing a surrogate pairs, means a string conating more than 30 wchar_t entities.
The string can be converted to the UTF8 field without any loss, because FB allows up to 30*4 bytes for the field. However, the driver does assume, that one wchar_t unit results in one char (covering up to 4 bytes in UTF8). The input value will be truncated to 30 wchar_t entities instead of 30 charachters.