From 180f871b5f18eebce1fda096c9148ad773f81a40 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 26 Nov 2023 21:20:45 +0900 Subject: Fix pasting UTF8 text from clipboard. This commit is based on work from Roman Savochenko available at PR #13, but adapted to the TDE standard. It replaces the aforementioned PR #13. Signed-off-by: Michele Calgaro (cherry picked from commit 50860c0fdea9a18e69c44c3dc083b6398cc5be7c) --- src/diff.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/diff.cpp b/src/diff.cpp index 2bf58eb..fba2c1a 100644 --- a/src/diff.cpp +++ b/src/diff.cpp @@ -241,7 +241,8 @@ void SourceData::setData( const TQString& data ) } FileAccess f( m_tempInputFileName ); - bool bSuccess = f.writeFile( TQTextCodec::codecForName("UTF-8")->fromUnicode(data), data.length() ); + TQCString cData = TQTextCodec::codecForName("UTF-8")->fromUnicode(data); + bool bSuccess = f.writeFile( cData, cData.length() ); if ( !bSuccess ) { KMessageBox::error( m_pOptionDialog, i18n("Writing clipboard data to temp file failed.") ); -- cgit v1.2.1