From bad201c5132117e8b227021b12ff9e5377a98496 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sun, 20 May 2012 15:48:24 +0300 Subject: fixed utf8 encoding in key list (finally ...) --- options.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'options.cpp') diff --git a/options.cpp b/options.cpp index 8efc0c2..0e952b7 100755 --- a/options.cpp +++ b/options.cpp @@ -151,10 +151,20 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA mir_free(tmp2); ListView_SetItemText(hwndList, iRow, 1, (_tcslen(tmp) > 1)?tmp:_T("not set")); mir_free(tmp); - tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", _T("")); + char *tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", ""); + if(!toUTF16(tmp2).empty()) + tmp = mir_wstrdup(toUTF16(tmp2).c_str()); + else + tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", _T("")); + mir_free(tmp2); ListView_SetItemText(hwndList, iRow, 2, (_tcslen(tmp) > 1)?tmp:_T("not set")); mir_free(tmp); - tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", _T("")); + tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", ""); + if(!toUTF16(tmp2).empty()) + tmp = mir_wstrdup(toUTF16(tmp2).c_str()); + else + tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", _T("")); + mir_free(tmp2); ListView_SetItemText(hwndList, iRow, 3, (_tcslen(tmp) > 1)?tmp:_T("not set")); mir_free(tmp); if(DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0)) -- cgit v1.2.3