rationalize UTF-16 handling and fix incorrect deletion of UTF-16 char from collected text