Added a condition to u8_nextchar to make sure that it returns zero for ends of strings, not a garbage value even if a UTF-8 continuation byte appears after the null character.