function added for sanitizing non-unicode text