diff options
-rw-r--r-- | protocols/Weather/src/weather.h | 1 | ||||
-rw-r--r-- | protocols/Weather/src/weather_addstn.cpp | 9 |
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;
|