*** kgpg/editor/kgpgview.cpp.old	2009-07-21 21:55:33.000000000 +0900
--- kgpg/editor/kgpgview.cpp	2009-06-07 00:30:42.000000000 +0900
***************
*** 331,336 ****
--- 331,337 ----
      interface->deleteLater();
  
      QString decryptedcontent;
+ #ifdef	ORIGINAL_CODE
      if (checkForUtf8(content))
      {
          decryptedcontent = QString::fromUtf8(content);
***************
*** 341,346 ****
--- 342,350 ----
          decryptedcontent = content;
          emit resetEncoding(false);
      }
+ #else
+     decryptedcontent = QString::fromLocal8Bit(content);
+ #endif
  
      QString fullcontent = toPlainText();
      fullcontent.replace(m_posstart, m_posend - m_posstart, decryptedcontent);
***************
*** 363,368 ****
--- 367,373 ----
          return;
      }
  
+ #ifdef	ORIGINAL_CODE
      if (checkForUtf8(content))
      {
          setPlainText(QString::fromUtf8(content.toAscii()));
***************
*** 373,378 ****
--- 378,386 ----
          setPlainText(content);
          emit resetEncoding(false);
      }
+ #else
+     setPlainText(content);
+ #endif
  }
  
  void KgpgTextEdit::slotVerifySuccess(const QString &content, const QString &log, KGpgTextInterface *interface)
*** kgpg/kgpgtextinterface.cpp.old	2009-07-21 21:58:22.000000000 +0900
--- kgpg/kgpgtextinterface.cpp	2009-06-07 02:01:16.000000000 +0900
***************
*** 159,169 ****
--- 159,173 ----
  void
  KGpgTextInterface::encryptText(const QString &text, const QStringList &userids, const QStringList &options)
  {
+ #ifdef	ORIGINAL_CODE
  	QTextCodec *codec = QTextCodec::codecForLocale();
  	if (codec->canEncode(text))
  		d->m_message = text;
  	else
  		d->m_message = text.toUtf8();
+ #else
+ 	d->m_message = text;
+ #endif
  
  	for (QStringList::ConstIterator it = options.constBegin(); it != options.constEnd(); ++it)
  		*d->m_process << QFile::encodeName(*it);
***************
*** 191,197 ****
--- 195,205 ----
  		if (line.startsWith("[GNUPG:] ")) {
  			line.remove(0, 9);
  			if (line.startsWith("BEGIN_ENCRYPTION")) {
+ #ifdef	ORIGINAL_CODE
  				d->m_process->write(d->m_message.toAscii());
+ #else
+ 				d->m_process->write(d->m_message.toLocal8Bit());
+ #endif
  				d->m_process->closeWriteChannel();
  				d->m_message.clear();
  			} else if (line.contains("passphrase.enter")) {
***************
*** 226,232 ****
--- 234,244 ----
  	connect(d->m_process, SIGNAL(processExited(GPGProc *)), this, SLOT(decryptTextFin()));
  	d->m_process->start();
  
+ #ifdef	ORIGINAL_CODE
  	d->m_process->write(text.toAscii());
+ #else
+ 	d->m_process->write(text.toLocal8Bit());
+ #endif
  }
  
  void
***************
*** 314,324 ****
--- 326,340 ----
  void
  KGpgTextInterface::signText(const QString &text, const QString &userid, const QStringList &options)
  {
+ #ifdef	ORIGINAL_CODE
  	QTextCodec *codec = QTextCodec::codecForLocale();
  	if (codec->canEncode(text))
  		d->m_message = text;
  	else
  		d->m_message = text.toUtf8();
+ #else
+ 	d->m_message = text;
+ #endif
  
  	for (QStringList::ConstIterator it = options.constBegin(); it != options.constEnd(); ++it)
  		*d->m_process << QFile::encodeName(*it);
***************
*** 344,350 ****
--- 360,370 ----
  				d->m_message.clear();
  				d->m_badpassword = true;
  			} else if (line.contains("GOOD_PASSPHRASE")) {
+ #ifdef	ORIGINAL_CODE
  				d->m_process->write(d->m_message.toAscii());
+ #else
+ 				d->m_process->write(d->m_message.toLocal8Bit());
+ #endif
  				d->m_process->closeWriteChannel();
  				d->m_message.clear();
  			} else if (line.contains("passphrase.enter")) {
***************
*** 352,358 ****
--- 372,382 ----
  					return;
  			}
  		} else 
+ #ifdef	ORIGINAL_CODE
  			d->m_message += line + '\n';
+ #else
+ 			d->m_message += QString::fromLocal8Bit(line) + '\n';
+ #endif
  	}
  }
  
***************
*** 372,382 ****
--- 396,410 ----
  void
  KGpgTextInterface::verifyText(const QString &text)
  {
+ #ifdef	ORIGINAL_CODE
  	QTextCodec *codec = QTextCodec::codecForLocale();
  	if (codec->canEncode(text))
  		d->m_message = text;
  	else
  		d->m_message = text.toUtf8();
+ #else
+ 	d->m_message = text;
+ #endif
  
  	*d->m_process << "--verify";
  
***************
*** 384,390 ****
--- 412,422 ----
  	connect(d->m_process, SIGNAL(processExited(GPGProc *)), this, SLOT(verifyTextFin()));
  	d->m_process->start();
  
+ #ifdef	ORIGINAL_CODE
  	d->m_process->write(d->m_message.toAscii());
+ #else
+ 	d->m_process->write(d->m_message.toLocal8Bit());
+ #endif
  	d->m_message.clear();
  	d->m_process->closeWriteChannel();
  }
