X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Futil.cpp;h=ea6c9310e23b886ac1cd43689326b1f26ac3d101;hb=51bd69f6e778ab83e4017172625c0decc8465e1b;hp=f792e02ddc12ae18a85d5382f3115118656408f3;hpb=dee29d77163776942488b38eb7691df51bb30bbc;p=metaproxy-moved-to-github.git diff --git a/src/util.cpp b/src/util.cpp index f792e02..ea6c931 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,5 +1,5 @@ /* This file is part of Metaproxy. - Copyright (C) 2005-2011 Index Data + Copyright (C) 2005-2012 Index Data Metaproxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -690,6 +690,17 @@ 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; }