author | zautrix <zautrix> | 2004-10-14 06:42:01 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-14 06:42:01 (UTC) |
commit | a6dff815a9c6d3a91094573d23c28a8553fc7cc2 (patch) (unidiff) | |
tree | a8830e9adcd72faa8178d4ee2517bfc31cda8653 /microkde | |
parent | 909d25797c50fc38c435834a68aaf60bf87e32f9 (diff) | |
download | kdepimpi-a6dff815a9c6d3a91094573d23c28a8553fc7cc2.zip kdepimpi-a6dff815a9c6d3a91094573d23c28a8553fc7cc2.tar.gz kdepimpi-a6dff815a9c6d3a91094573d23c28a8553fc7cc2.tar.bz2 |
fixes umlaute in beaming
-rw-r--r-- | microkde/kapplication.cpp | 22 | ||||
-rw-r--r-- | microkde/kapplication.h | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index 98ef2f2..56c01af 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -66,2 +66,24 @@ void KApplication::showFile(QString caption, QString fn) | |||
66 | 66 | ||
67 | bool KApplication::convert2latin1(QString fileName) | ||
68 | { | ||
69 | QString text; | ||
70 | QFile file( fileName ); | ||
71 | if (!file.open( IO_ReadOnly ) ) { | ||
72 | return false; | ||
73 | |||
74 | } | ||
75 | QTextStream ts( &file ); | ||
76 | ts.setEncoding( QTextStream::UnicodeUTF8 ); | ||
77 | text = ts.read(); | ||
78 | file.close(); | ||
79 | if (!file.open( IO_WriteOnly ) ) { | ||
80 | return false; | ||
81 | } | ||
82 | QTextStream tsIn( &file ); | ||
83 | tsIn.setEncoding( QTextStream::Latin1 ); | ||
84 | tsIn << text.latin1(); | ||
85 | file.close(); | ||
86 | |||
87 | |||
88 | } | ||
67 | void KApplication::showText(QString caption, QString text) | 89 | void KApplication::showText(QString caption, QString text) |
diff --git a/microkde/kapplication.h b/microkde/kapplication.h index 79cdb33..41546a0 100644 --- a/microkde/kapplication.h +++ b/microkde/kapplication.h | |||
@@ -22,2 +22,3 @@ class KApplication | |||
22 | static void showText(QString caption, QString text); | 22 | static void showText(QString caption, QString text); |
23 | static bool convert2latin1(QString file); | ||
23 | }; | 24 | }; |