summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xoptions.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/options.cpp b/options.cpp
index b067cb3..5f0c99f 100755
--- a/options.cpp
+++ b/options.cpp
@@ -358,6 +358,14 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if(OpenClipboard(hwndDlg))
{
char *szKey = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", "");
+ TCHAR *buf = mir_utf8decodeT(szKey);
+ mir_free(szKey);
+ std::wstring str = buf;
+ mir_free(buf);
+ for(std::wstring::size_type i = str.find(_T("\n")); i != std::wstring::npos; i = str.find(_T("\n"), i+2))
+ str.replace(i, 1, _T("\r\n"));
+ szKey = mir_utf8encodeW(str.c_str());
+ str.clear();
EmptyClipboard();
if(!SetClipboardData(CF_OEMTEXT, szKey))
{