diff options
author | Szymon Tokarz <wsx22@o2.pl> | 2012-12-22 00:30:47 +0000 |
---|---|---|
committer | Szymon Tokarz <wsx22@o2.pl> | 2012-12-22 00:30:47 +0000 |
commit | 1b50be65056f9f625a2242b3eab128b2c1c2ad7f (patch) | |
tree | 6fd7a6af17c7f78b312e669b24bd10bf85061873 /protocols/Gadu-Gadu/src/image.cpp | |
parent | 5d674840ea8cafd9975bd5f1ce7aa13a504891c5 (diff) |
Gadu-Gadu protocol:
Change libgadu gg encoding from GG_ENCODING_CP1250 to GG_ENCODING_UTF8 and support it.
This is a long-awaited change with introducing UTF-8 support at:
- messages
- status descriptions (fixes issue #8)
- group chats
(searching and public directory not support UTF-8 beacouse of libgadu limitations, thats works as previously)
Thanks to Tomasz Figa for his path from http://code.google.com/p/miranda/issues/detail?id=1195
git-svn-id: http://svn.miranda-ng.org/main/trunk@2786 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/image.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/image.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index a24fffb720..f3a36a4c3c 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -74,10 +74,10 @@ int GGPROTO::img_init() // Send image contact menu item
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIF_ICONFROMICOLIB;
+ mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.position = -2000010000;
mi.icolibItem = iconList[11].hIcolib;
- mi.pszName = LPGEN("&Image");
+ mi.ptszName = LPGENT("&Image");
mi.pszService = service;
mi.pszContactOwner = m_szModuleName;
hImageMenuItem = Menu_AddContactMenuItem(&mi);
@@ -848,18 +848,19 @@ int GGPROTO::img_displayasmsg(HANDLE hContact, void *img) }
if (res != 0) {
- char image_msg[MAX_PATH + 11];
- mir_snprintf(image_msg, SIZEOF(image_msg), "[img]%s[/img]", (char*)_T2A(szPath));
+ TCHAR image_msg[MAX_PATH + 11];
+ mir_sntprintf(image_msg, SIZEOF(image_msg), _T("[img]%s[/img]"), szPath);
PROTORECVEVENT pre = {0};
+ pre.flags = PREF_TCHAR;
pre.timestamp = time(NULL);
- pre.szMessage = image_msg;
+ pre.tszMessage = image_msg;
ProtoChainRecvMsg(hContact, &pre);
- netlog("img_displayasmsg(): Image saved to %s.", szPath);
+ netlog("img_displayasmsg(): Image saved to %S.", szPath);
}
else
{
- netlog("img_displayasmsg(): Cannot save image to %s.", szPath);
+ netlog("img_displayasmsg(): Cannot save image to %S.", szPath);
}
return 0;
@@ -969,7 +970,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName) FILE *fp = _tfopen(szFileName, _T("rb"));
if (!fp) {
free(dat);
- netlog("img_loadpicture(): fopen(\"%s\", \"rb\") failed.", szFileName);
+ netlog("img_loadpicture(): fopen(\"%S\", \"rb\") failed.", szFileName);
return NULL;
}
fseek(fp, 0, SEEK_END);
@@ -978,7 +979,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName) {
fclose(fp);
free(dat);
- netlog("img_loadpicture(): Zero file size \"%s\" failed.", szFileName);
+ netlog("img_loadpicture(): Zero file size \"%S\" failed.", szFileName);
return NULL;
}
// Maximum acceptable image size
@@ -986,7 +987,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName) {
fclose(fp);
free(dat);
- netlog("img_loadpicture(): Image size of \"%s\" exceeds 255 KB.", szFileName);
+ netlog("img_loadpicture(): Image size of \"%S\" exceeds 255 KB.", szFileName);
MessageBox(NULL, TranslateT("Image exceeds maximum allowed size of 255 KB."), m_tszUserName, MB_OK | MB_ICONEXCLAMATION);
return NULL;
}
@@ -997,7 +998,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName) free(dat->lpData);
fclose(fp);
free(dat);
- netlog("img_loadpicture(): Reading file \"%s\" failed.", szFileName);
+ netlog("img_loadpicture(): Reading file \"%S\" failed.", szFileName);
return NULL;
}
fclose(fp);
|