Issue #275: fix out of bounds read when handling unicode surrogate pairs.