Is there an equivalent of JavaScript's unescape() in Golang?
JavaScript example:
<script>
var c = unescape('%u0107'); // "ć"
console.log(c);
</script>
The unescape function is marked as "Deprecated" (red trash can), in the Mozilla documentation [1]. As such, I wouldn't recommend using it, and certainly not seeking out an equivalent Go function. Go has a similar function [2], but it expects different input from what you have provided:
package main
import "net/url"
func main() {
s, err := url.PathUnescape("%C4%87")
if err != nil {
panic(err)
}
println(s == "ć")
}
If you are really set on doing this, you could see about translating this polyfill [3].