less sketchy handling of NUL byte, now the only caveat is mismatched surrogate assertion