From a6dff815a9c6d3a91094573d23c28a8553fc7cc2 Mon Sep 17 00:00:00 2001 From: zautrix Date: Thu, 14 Oct 2004 06:42:01 +0000 Subject: fixes umlaute in beaming --- (limited to 'microkde/kapplication.cpp') diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index 98ef2f2..56c01af 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp @@ -64,6 +64,28 @@ void KApplication::showFile(QString caption, QString fn) } +bool KApplication::convert2latin1(QString fileName) +{ + QString text; + QFile file( fileName ); + if (!file.open( IO_ReadOnly ) ) { + return false; + + } + QTextStream ts( &file ); + ts.setEncoding( QTextStream::UnicodeUTF8 ); + text = ts.read(); + file.close(); + if (!file.open( IO_WriteOnly ) ) { + return false; + } + QTextStream tsIn( &file ); + tsIn.setEncoding( QTextStream::Latin1 ); + tsIn << text.latin1(); + file.close(); + + +} void KApplication::showText(QString caption, QString text) { QDialog dia( 0, "name", true ); ; -- cgit v0.9.0.2