Fix UTF-16 surrogate handling. [BZ #19727]