Add check newCharPerLine not being zero to fix an endless loop condition on text with only two out-of-bounds unicode characters