we do a different kind of newline translation nowadays, and also \r\n is now counted as a single grapheme cluster. maybe the code needs changing.