diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-06 08:58:27 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-06 08:58:27 +0000 |
commit | b61ba851da0157ace3bdfc1ebbf87156b0b76413 (patch) | |
tree | d6c567db57af1eb09c254a8bee13c305282334f8 /protocols/Twitter/http.cpp | |
parent | a4c70f6bedb25e5cffb08dfc5cbc2597d1642d6b (diff) |
protocols plugins moved to protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@327 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Twitter/http.cpp')
-rw-r--r-- | protocols/Twitter/http.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/protocols/Twitter/http.cpp b/protocols/Twitter/http.cpp new file mode 100644 index 0000000000..63218ca616 --- /dev/null +++ b/protocols/Twitter/http.cpp @@ -0,0 +1,39 @@ +/*
+Copyright © 2009 Jim Porter
+
+This program 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 Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "common.h"
+#include "http.h"
+
+std::string http::url_encode(const std::string &s)
+{
+ char *encoded = (char*)CallService( MS_NETLIB_URLENCODE, 0, ( LPARAM )s.c_str());
+ std::string ret = encoded;
+ HeapFree(GetProcessHeap(),0,encoded);
+
+ return ret;
+}
+
+std::string http::url_encode(const std::wstring &s)
+{
+ char* data = mir_u2a( s.c_str());
+ char *encoded = (char*)CallService( MS_NETLIB_URLENCODE, 0, ( LPARAM )data);
+ mir_free( data );
+ std::string ret = encoded;
+ HeapFree(GetProcessHeap(),0,encoded);
+
+ return ret;
+}
|