summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/main.cpp b/main.cpp
index 70709e0..27ed44e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -110,31 +110,31 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
break;
stop = p;
p2 = out.find("/", p) - 1;
- TCHAR *tmp = mir_utf8decodeW(out.substr(p,p2-p).c_str());
+ TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
item.pszText = tmp;
iRow = ListView_InsertItem(hwndList, &item);
ListView_SetItemText(hwndList, iRow, 4, tmp);
mir_free(tmp);
p2+=2;
p = out.find(" ", p2);
- tmp = mir_utf8decodeW(out.substr(p2,p-p2).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p2,p-p2)).c_str());
ListView_SetItemText(hwndList, iRow, 0, tmp);
mir_free(tmp);
p = out.find("uid ", p);
p2 = out.find_first_not_of(" ", p+5);
p = out.find("<", p2);
- tmp = mir_utf8decodeW(out.substr(p2,p-p2).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p2,p-p2)).c_str());
ListView_SetItemText(hwndList, iRow, 2, tmp);
mir_free(tmp);
p++;
p2 = out.find(">", p);
- tmp = mir_utf8decodeW(out.substr(p,p2-p).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
ListView_SetItemText(hwndList, iRow, 1, tmp);
mir_free(tmp);
p = out.find("ssb ", p2) + 6;
p = out.find(" ", p) + 1;
p2 = out.find("\n", p);
- tmp = mir_utf8decodeW(out.substr(p,p2-p-1).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p-1)).c_str());
ListView_SetItemText(hwndList, iRow, 3, tmp);
mir_free(tmp);
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);// not sure about this
@@ -276,31 +276,31 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
break;
stop = p;
p2 = out.find("/", p) - 1;
- TCHAR *tmp = mir_utf8decodeW(out.substr(p,p2-p).c_str());
+ TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
item.pszText = tmp;
iRow = ListView_InsertItem(hwndList, &item);
ListView_SetItemText(hwndList, iRow, 4, tmp);
mir_free(tmp);
p2+=2;
p = out.find(" ", p2);
- tmp = mir_utf8decodeW(out.substr(p2,p-p2).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p2,p-p2)).c_str());
ListView_SetItemText(hwndList, iRow, 0, tmp);
mir_free(tmp);
p = out.find("uid ", p);
p2 = out.find_first_not_of(" ", p+5);
p = out.find("<", p2);
- tmp = mir_utf8decodeW(out.substr(p2,p-p2).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p2,p-p2)).c_str());
ListView_SetItemText(hwndList, iRow, 2, tmp);
mir_free(tmp);
p++;
p2 = out.find(">", p);
- tmp = mir_utf8decodeW(out.substr(p,p2-p).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
ListView_SetItemText(hwndList, iRow, 1, tmp);
mir_free(tmp);
p = out.find("ssb ", p2) + 6;
p = out.find(" ", p) + 1;
p2 = out.find("\n", p);
- tmp = mir_utf8decodeW(out.substr(p,p2-p-1).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p-1)).c_str());
ListView_SetItemText(hwndList, iRow, 3, tmp);
mir_free(tmp);
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);// not sure about this
@@ -853,7 +853,7 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
if(tmp[0])
{
f<<"Passphrase: ";
- tmp2 = mir_utf8encodeW(tmp);
+ tmp2 = mir_strdup(toUTF8(tmp).c_str());
f<<tmp2;
f<<"\n";
mir_free(tmp2);
@@ -862,7 +862,7 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
f<<"Name-Real: ";
tmp = new TCHAR [128];
GetDlgItemText(hwndDlg, IDC_KEY_REAL_NAME, tmp, 128);
- tmp2 = mir_utf8encodeW(tmp);
+ tmp2 = mir_strdup(toUTF8(tmp).c_str());
f<<tmp2;
mir_free(tmp2);
delete [] tmp;
@@ -871,7 +871,7 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
GetDlgItemText(hwndDlg, IDC_KEY_COMMENT, tmp, 512);
if(tmp[0])
{
- tmp2 = mir_utf8encodeW(tmp);
+ tmp2 = mir_strdup(toUTF8(tmp).c_str());
f<<"Name-Comment: ";
f<<tmp2;
f<<"\n";
@@ -881,7 +881,7 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
f<<"Name-Email: ";
tmp = new TCHAR [128];
GetDlgItemText(hwndDlg, IDC_KEY_EMAIL, tmp, 128);
- tmp2 = mir_utf8encodeW(tmp);
+ tmp2 = mir_strdup(toUTF8(tmp).c_str());
f<<tmp2;
mir_free(tmp2);
delete [] tmp;
@@ -889,7 +889,7 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
f<<"Expire-Date: ";
tmp = new TCHAR [12];
GetDlgItemText(hwndDlg, IDC_KEY_EXPIRE_DATE, tmp, 12);
- tmp2 = mir_utf8encodeW(tmp);
+ tmp2 = mir_strdup(toUTF8(tmp).c_str());
f<<tmp2;
mir_free(tmp2);
delete [] tmp;
@@ -967,31 +967,31 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
stop = p;
p2 = out.find("/", p) - 1;
- TCHAR *tmp = mir_utf8decodeW(out.substr(p,p2-p).c_str());
+ TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
item.pszText = tmp;
iRow = ListView_InsertItem(hwndList_g, &item);
ListView_SetItemText(hwndList_g, iRow, 4, tmp);
mir_free(tmp);
p2+=2;
p = out.find(" ", p2);
- tmp = mir_utf8decodeW(out.substr(p2,p-p2).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p2,p-p2)).c_str());
ListView_SetItemText(hwndList_g, iRow, 0, tmp);
mir_free(tmp);
p = out.find("uid ", p);
p2 = out.find_first_not_of(" ", p+5);
p = out.find("<", p2);
- tmp = mir_utf8decodeW(out.substr(p2,p-p2).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p2,p-p2)).c_str());
ListView_SetItemText(hwndList_g, iRow, 2, tmp);
mir_free(tmp);
p++;
p2 = out.find(">", p);
- tmp = mir_utf8decodeW(out.substr(p,p2-p).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
ListView_SetItemText(hwndList_g, iRow, 1, tmp);
mir_free(tmp);
p = out.find("ssb ", p2) + 6;
p = out.find(" ", p) + 1;
p2 = out.find("\n", p);
- tmp = mir_utf8decodeW(out.substr(p,p2-p-1).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p-1)).c_str());
ListView_SetItemText(hwndList_g, iRow, 3, tmp);
mir_free(tmp);
ListView_SetColumnWidth(hwndList_g, 0, LVSCW_AUTOSIZE);// not sure about this
@@ -1117,31 +1117,31 @@ static BOOL CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wParam,
break;
stop = p;
p2 = out.find("/", p) - 1;
- TCHAR *tmp = mir_utf8decodeW(out.substr(p,p2-p).c_str());
+ TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
item.pszText = tmp;
iRow = ListView_InsertItem(hwndList, &item);
ListView_SetItemText(hwndList, iRow, 4, tmp);
mir_free(tmp);
p2+=2;
p = out.find(" ", p2);
- tmp = mir_utf8decodeW(out.substr(p2,p-p2).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p2,p-p2)).c_str());
ListView_SetItemText(hwndList, iRow, 0, tmp);
mir_free(tmp);
p = out.find("uid ", p);
p2 = out.find_first_not_of(" ", p+5);
p = out.find("<", p2);
- tmp = mir_utf8decodeW(out.substr(p2,p-p2).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p2,p-p2)).c_str());
ListView_SetItemText(hwndList, iRow, 2, tmp);
mir_free(tmp);
p++;
p2 = out.find(">", p);
- tmp = mir_utf8decodeW(out.substr(p,p2-p).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
ListView_SetItemText(hwndList, iRow, 1, tmp);
mir_free(tmp);
p = out.find("sub ", p2) + 6;
p = out.find(" ", p) + 1;
p2 = out.find("\n", p);
- tmp = mir_utf8decodeW(out.substr(p,p2-p-1).c_str());
+ tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p-1)).c_str());
ListView_SetItemText(hwndList, iRow, 3, tmp);
mir_free(tmp);
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);// not sure about this
@@ -1676,7 +1676,7 @@ void ImportKey()
DBDeleteContactSetting(hContact, szGPGModuleName, "bAlwatsTrust");
}
}
- ptmp = mir_utf8decodeW(output.c_str());
+ ptmp = mir_wstrdup(toUTF16(output).c_str());
MessageBox(0, ptmp, _T(""), MB_OK);
mir_free(ptmp);
DeleteFile(tmp2);