Added new memEncodeUTF16 with explicit target buffer.