summaryrefslogtreecommitdiffstats
path: root/common/paths/url.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/paths/url.go')
-rw-r--r--common/paths/url.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/paths/url.go b/common/paths/url.go
index 093ba9ff7..4c4a7f2dc 100644
--- a/common/paths/url.go
+++ b/common/paths/url.go
@@ -184,3 +184,13 @@ func UrlToFilename(s string) (string, bool) {
return p, true
}
+
+// URLEscape escapes unicode letters.
+func URLEscape(uri string) string {
+ // escape unicode letters
+ u, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ return u.String()
+}