diff options
Diffstat (limited to 'libs/ardour/utils.cc')
-rw-r--r-- | libs/ardour/utils.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index d034eea6ee..ad0823ddaf 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -111,6 +111,17 @@ legalize_for_universal_path (const string& str) return replace_chars (str, "<>:\"/\\|?*"); } +/** Legalize for a URI path component. This is like + * legalize_for_universal_path, but stricter, disallowing spaces and hash. + * This avoids %20 escapes in URIs, but probably needs work to be more strictly + * correct. + */ +string +legalize_for_uri (const string& str) +{ + return replace_chars (str, "<>:\"/\\|?* #"); +} + /** take an arbitrary string as an argument, and return a version of it * suitable for use as a path (directory/folder name). This is the Ardour 2.X * version of this code, which used an approach that came to be seen as |