replace invalid character.