Add processing to remove duplicated escape characters

pull/13739/head
Toshiaki Inukai 2022-03-02 04:11:18 +00:00
parent cc7b6b9741
commit 249392038d
1 changed files with 6 additions and 0 deletions

View File

@ -355,6 +355,12 @@ func checkString(s string) string {
}
}
// Remove unnecessary backslashes
if s[0] == '"' {
r := strings.NewReplacer(`\\`, "\\", `\a`, "\a", `\b`, "\b", `\f`, "\f", `\n`, "\n", `\r`, "\r", `\t`, "\t", `\v`, "\v", `\"`, "\"")
stringToTranslate = r.Replace(stringToTranslate)
}
// Hooray, we can translate the string!
return stringToTranslate
}