diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-02-09 04:23:59 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-02-09 04:23:59 +0400 |
commit | e3488af838e6c43e5e3d9635d7604ab04f5a9b27 (patch) | |
tree | 3105375f1c67c2e5b24815ee633e576eef3ad078 /source/blender/collada/collada_utils.cpp | |
parent | deeeaed3d858cf8be7d9fba294e96db3778aa587 (diff) |
fixed: [#34080] import of COLLADA breaks on '#' in filepath
Diffstat (limited to 'source/blender/collada/collada_utils.cpp')
-rw-r--r-- | source/blender/collada/collada_utils.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index 9fdca048177..27af5c0aba2 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -286,3 +286,20 @@ int bc_get_active_UVLayer(Object *ob) Mesh *me = (Mesh *)ob->data; return CustomData_get_active_layer_index(&me->fdata, CD_MTFACE); } + +std::string bc_url_encode(std::string data) { + /* XXX We probably do not need to do a full encoding. + But in case that is necessary,then it can be added here. + */ + return bc_replace_string(data,"#", "%23"); +} + +std::string bc_replace_string(std::string data, const std::string& pattern, + const std::string& replacement) { + size_t pos = 0; + while((pos = data.find(pattern, pos)) != std::string::npos) { + data.replace(pos, pattern.length(), replacement); + pos += replacement.length(); + } + return data; +}
\ No newline at end of file |