summaryrefslogtreecommitdiff
path: root/otr/dllmain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'otr/dllmain.cpp')
-rw-r--r--otr/dllmain.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/otr/dllmain.cpp b/otr/dllmain.cpp
index 26300bb..b6291cf 100644
--- a/otr/dllmain.cpp
+++ b/otr/dllmain.cpp
@@ -629,7 +629,9 @@ int OTRSendMessage(WPARAM wParam,LPARAM lParam){
//MessageBox(0, "Send message - converting to UTF-8", "msg", MB_OK);
- if(ccs->wParam & PREF_UNICODE) {
+ if(ccs->wParam & PREF_UTF) {
+ oldmessage_utf = strdup(oldmessage);
+ } else if(ccs->wParam & PREF_UNICODE) {
int size = WideCharToMultiByte(CP_UTF8, 0, (wchar_t *)&oldmessage[strlen(oldmessage)+1], -1, 0, 0, 0, 0);
oldmessage_utf = (char *)malloc(size);
if(!oldmessage_utf) return 1;
@@ -786,7 +788,9 @@ int RecvMessage(WPARAM wParam,LPARAM lParam){
if(!proto || !uname) return 1; // error
// convert oldmessage to utf-8
- if(ccs->wParam & PREF_UNICODE) {
+ if(ccs->wParam & PREF_UTF) {
+ oldmessage_utf = strdup(oldmessage);
+ } else if(ccs->wParam & PREF_UNICODE) {
int size = WideCharToMultiByte(CP_UTF8, 0, (wchar_t *)&oldmessage[strlen(oldmessage)+1], -1, 0, 0, 0, 0);
oldmessage_utf = (char *)malloc(size);
if(!oldmessage_utf) return 1;