added faster character escapes and checks