Should this be using UTF8 rather than a STRING?  

(I've opened HPCC-9939 to simplify conversion of strings->Unicode, which would make this less cubersome)