summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-10-19 08:22:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-10-19 08:22:16 +0000
commit2fbe86924f7ac0ec1b18fcc35805006456a305c2 (patch)
tree0952feb667910cfce1de3c551188d0cd3e5e12fa
parentfb99345d32aa63a503b42ec3b004871824c982a4 (diff)
unicode in Weather search
git-svn-id: http://svn.miranda-ng.org/main/trunk@1980 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/Weather/src/weather.h1
-rw-r--r--protocols/Weather/src/weather_addstn.cpp9
2 files changed, 7 insertions, 3 deletions
diff --git a/protocols/Weather/src/weather.h b/protocols/Weather/src/weather.h
index 400d5e6778..6541b24f31 100644
--- a/protocols/Weather/src/weather.h
+++ b/protocols/Weather/src/weather.h
@@ -43,6 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <newpluginapi.h>
#include <m_system.h>
+#include <m_system_cpp.h>
#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_clist.h>
diff --git a/protocols/Weather/src/weather_addstn.cpp b/protocols/Weather/src/weather_addstn.cpp
index 31a83f75fc..f4f3740023 100644
--- a/protocols/Weather/src/weather_addstn.cpp
+++ b/protocols/Weather/src/weather_addstn.cpp
@@ -307,9 +307,12 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR *
TCHAR Name[MAX_DATA_LEN], str[MAX_DATA_LEN], sID[MAX_DATA_LEN], *szData = NULL, *search;
// replace spaces with %20
- char *pstr = (char*)CallService(MS_NETLIB_URLENCODE, 0, (LPARAM)(char*)_T2A(name));
- wsprintfA(loc, sData->SearchURL, pstr);
- HeapFree(GetProcessHeap(), 0, pstr);
+ {
+ mir_ptr<char> szSearchName( mir_utf8encodeT(name));
+ char *pstr = (char*)CallService(MS_NETLIB_URLENCODE, 0, (LPARAM)(char*)szSearchName);
+ wsprintfA(loc, sData->SearchURL, pstr);
+ HeapFree(GetProcessHeap(), 0, pstr);
+ }
if (InternetDownloadFile(loc, NULL, &szData) == 0) {
TCHAR* szInfo = szData;