Escape invalid characters