Throw exception in 1.8 mode for empty string

Also simplifies the \0 check for symbols with a \0 contained in it.