This gives us more accurate string length calculations. In particular, it handles emoji and other scripts properly.