Add bound checks to utf16_to_utf8
am: 1deedbacc3

Change-Id: I05847ae2c26a266b3c05324230062757e6978fd2