Yes, it appears to cause a hang. view.substr() appears to return u'\x00' on ST2, '' on ST3. So using
return nextChar == '\0' or nextChar == ''
appears to work for both cases.