I haven't looked at the patch, but offhand I wonder if it's worthconsidering control characters added by unicode, if you haven't already.
--Peter Geoghegan