DO NOT MERGE Add bound checks to utf16_to_utf8
am: 0d9d569c26

Change-Id: Ic54078ce7eed59b04e6e4862bf2daf2aa0185950