HPCC-11402 Extracting a unicode string from a varunicode could truncate it

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #5867 from ghalliday/issue11402

HPCC-11402 Extracting a unicode string from a varunicode could truncate it

Reviewed-By: Jamie Noss <james.noss@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>