The problem that I met is that
Given a string contains several special substrings like:
"\\u0301" "\\b" "\\t",..etc
Please convert all special strings above into "\u0301","\b","\t", ..etc
Note that if just removing a backslash here,
you will get a plaintext of "\u0301",
instead an accent mark of Unicode.
A one-by-one solution is to replace each special string
str = strings.Replace(str, "\\u0301","\u0301", -1)
Is a general solution to all escape character codes?
If you need to convert a byte sequence that contains escaped Unicode sequences and control sequences to a Unicode string, then you can use strconv.Unquote function.
To do this, convert the bytes to a string, escape the double-quote and newline characters, and add double-quote characters at the beginning and end of this string.
Output:
https://go.dev/play/p/WRsNGOT1zLR