X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Futil.cpp;h=1f335a18a61ba3a65aebfb141a0ae580fd5a180d;hb=3e584362b6933174b28cf98ff3138a589ed8326d;hp=27916bafa035a6581b16e25a0fd7b4cc424a26aa;hpb=1f20fd7b81d922d36a843cc3d157f8473912812c;p=metaproxy-moved-to-github.git diff --git a/src/util.cpp b/src/util.cpp index 27916ba..1f335a1 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,13 @@ 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: