X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Futil.cpp;h=f792e02ddc12ae18a85d5382f3115118656408f3;hb=dee29d77163776942488b38eb7691df51bb30bbc;hp=27916bafa035a6581b16e25a0fd7b4cc424a26aa;hpb=f1495eba3dd50de9bd6e5e0e604320b6cc6bf1a7;p=metaproxy-moved-to-github.git diff --git a/src/util.cpp b/src/util.cpp index 27916ba..f792e02 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include +#include #include @@ -684,6 +685,14 @@ Z_ReferenceId **mp_util::get_referenceId(const Z_APDU *apdu) return 0; } +std::string mp_util::uri_encode(std::string s) +{ + char *x = (char *) xmalloc(1 + s.length() * 3); + yaz_encode_uri_component(x, s.c_str()); + std::string result(x); + return result; +} + /* * Local variables: