X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Futil.cpp;h=4265682ce4e7577bdef6234020f0cef0464f5205;hb=3b9de1c22d69590ad7470a27f9091f61bb825d7e;hp=1f335a18a61ba3a65aebfb141a0ae580fd5a180d;hpb=3e584362b6933174b28cf98ff3138a589ed8326d;p=metaproxy-moved-to-github.git diff --git a/src/util.cpp b/src/util.cpp index 1f335a1..4265682 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -690,9 +690,21 @@ 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); + xfree(x); return result; } + +std::string mp_util::uri_decode(std::string s) +{ + char *x = (char *) xmalloc(1 + s.length()); + yaz_decode_uri_component(x, s.c_str(), s.length()); + std::string result(x); + xfree(x); + return result; +} + + /* * Local variables: * c-basic-offset: 4