Unify URI encoding/decoding and add to C#

http_escape and percent_encode have been unified into uri_encode, and http_unescape and percent_decode have been unified into uri_decode.
This commit is contained in:
Aaron Franke 2020-11-29 22:43:38 -05:00
parent a3e3bf8227
commit e829b7aee4
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
15 changed files with 81 additions and 142 deletions

View file

@ -289,7 +289,7 @@ void Collada::_parse_image(XMLParser &parser) {
String path = parser.get_attribute_value("source").strip_edges();
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
image.path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir().plus_file(path.percent_decode()));
image.path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir().plus_file(path.uri_decode()));
}
} else {
while (parser.read() == OK) {
@ -298,7 +298,7 @@ void Collada::_parse_image(XMLParser &parser) {
if (name == "init_from") {
parser.read();
String path = parser.get_node_data().strip_edges().percent_decode();
String path = parser.get_node_data().strip_edges().uri_decode();
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path

View file

@ -900,7 +900,7 @@ void EditorAssetLibrary::_search(int p_page) {
}
if (filter->get_text() != String()) {
args += "&filter=" + filter->get_text().http_escape();
args += "&filter=" + filter->get_text().uri_encode();
}
if (p_page > 0) {