That's what surrogate pairs are for. [1] You're no longer working with one code point per character, but even with 32-bit Unicode there's no real guarantee of that (consider things like combining characters, accents, emoji skin tones, etc.)
[1] https://msdn.microsoft.com/en-us/library/windows/desktop/dd3...