IMO it should try to only consider `\\` and `\"` when doing this calculation. Other escapes aren't technically necessary in a normal string. So just iterate over the characters, and count `\` and `"` as double.