Files
go2tv/soapcalls/utils/urlencoder.go
2023-05-01 19:48:14 +03:00

15 lines
263 B
Go

package utils
import (
"net/url"
"path"
"strings"
)
// ConvertFilename is a helper function that percent-encodes a string.
func ConvertFilename(s string) string {
out := url.QueryEscape(path.Base(s))
out = strings.ReplaceAll(out, "+", "%20")
return out
}