Handle UTF-16 encoding, more debug messages.