As title, it should implement this method to validate the string is safe with the valid characters.
It has more detailed unit test is about that link.