Improve non-ASCII test by checking for the actual escape sequence.