From fcd99c95104fda007001301ee455bcd15973cda0 Mon Sep 17 00:00:00 2001 From: crs Date: Mon, 22 Jul 2002 18:46:57 +0000 Subject: [PATCH] checkpoint. more UTF8 clipboard stuff. --- base/CUnicode.cpp | 4 ++-- platform/CXWindowsClipboard.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/base/CUnicode.cpp b/base/CUnicode.cpp index 48834192..8925752d 100644 --- a/base/CUnicode.cpp +++ b/base/CUnicode.cpp @@ -54,7 +54,7 @@ CUnicode::UTF8ToUCS2(const CString& src) const UInt8* data = reinterpret_cast(src.c_str()); while (n > 0) { UInt32 c = fromUTF8(data, n); - if (c != s_invalid && c < 0x0000ffff) { + if (c != s_invalid && c < 0x00010000) { UInt16 ucs2 = static_cast(c); dst.append(reinterpret_cast(&ucs2), 2); } @@ -223,7 +223,7 @@ CUnicode::UTF8ToWideChar(const CString& src) // copy to a wchar_t array wchar_t* dst = new wchar_t[size]; - ::memcpy(dst, src.data(), sizeof(wchar_t) * size); + ::memcpy(dst, tmp.data(), sizeof(wchar_t) * size); return dst; } diff --git a/platform/CXWindowsClipboard.cpp b/platform/CXWindowsClipboard.cpp index caff177a..e1f19eff 100644 --- a/platform/CXWindowsClipboard.cpp +++ b/platform/CXWindowsClipboard.cpp @@ -164,6 +164,8 @@ log((CLOG_INFO "added")); type = converter->getAtom(); format = converter->getDataSize(); data = converter->fromIClipboard(m_data[clipboardFormat]); +log((CLOG_INFO " src: (%d) %s", m_data[clipboardFormat].size(), m_data[clipboardFormat].c_str())); +log((CLOG_INFO " dst: (%d) %s", data.size(), data.c_str())); } } }