diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-10 15:23:07 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-10 15:23:07 +0000 |
commit | b7e047f64d8b79e5b6cf9ea682a09d575821129c (patch) | |
tree | 63853a1002e0c7976b7b066288009e3319496fcf /protocols/Twitter/proto.cpp | |
parent | 101ca36412b3e7b8851b6b48a4f6cbc17d9f9eff (diff) |
fix for the russian tweets' sending
git-svn-id: http://svn.miranda-ng.org/main/trunk@380 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Twitter/proto.cpp')
-rw-r--r-- | protocols/Twitter/proto.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/protocols/Twitter/proto.cpp b/protocols/Twitter/proto.cpp index b90b9b477b..c1babf5c71 100644 --- a/protocols/Twitter/proto.cpp +++ b/protocols/Twitter/proto.cpp @@ -186,6 +186,14 @@ int TwitterProto::SendMsg(HANDLE hContact,int flags,const char *msg) if(m_iStatus != ID_STATUS_ONLINE)
return 0;
+ TCHAR* tszMsg;
+ if ( flags & PREF_UTF )
+ tszMsg = mir_utf8decodeT( msg );
+ else if ( flags & PREF_UNICODE )
+ tszMsg = mir_u2t(( wchar_t* )&msg[ strlen( msg )+1 ] );
+ else
+ tszMsg = mir_a2t( msg );
+
ForkThread(&TwitterProto::SendSuccess, this,new send_direct(hContact,msg));
return 1;
}
@@ -505,24 +513,24 @@ void TwitterProto::ShowPopup(const char *text, int Error) MessageBox(0,popup.lptzText,popup.lptzContactName,0);
}
-int TwitterProto::LOG(const char *fmt,...)
+int TwitterProto::LOG(TCHAR *fmt,...)
{
va_list va;
- char text[1024];
+ TCHAR text[1024];
if (!hNetlib_)
return 0;
va_start(va,fmt);
- mir_vsnprintf(text,sizeof(text),fmt,va);
+ mir_vsntprintf(text,SIZEOF(text),fmt,va);
va_end(va);
return CallService(MS_NETLIB_LOG, (WPARAM)hNetlib_, (LPARAM)text);
}
-int TwitterProto::WLOG(const char* first, const wstring last)
+int TwitterProto::WLOG(TCHAR* first, const wstring last)
{
- char *str1 = new char[1024*96];
- sprintf(str1,"%ls", last.c_str());
+ TCHAR *str1 = new TCHAR[1024*96];
+ _stprintf(str1,_T("%s"), last.c_str());
return LOG(first, str1);
}
|