Add Unicode helper functions for converting to UTF16 (we need this to translate offsets for the Mac UI).