author | gints <gints> | 2005-01-02 12:23:29 (UTC) |
---|---|---|
committer | gints <gints> | 2005-01-02 12:23:29 (UTC) |
commit | 4604bcd95999c9f66f500d385494ab7767cbf3a4 (patch) (unidiff) | |
tree | 74264959c8e7cfa06a11f825a7d84579579d60bb | |
parent | f6063d2168022a6b6c8617d9da4a781d7895cbae (diff) | |
download | opie-4604bcd95999c9f66f500d385494ab7767cbf3a4.zip opie-4604bcd95999c9f66f500d385494ab7767cbf3a4.tar.gz opie-4604bcd95999c9f66f500d385494ab7767cbf3a4.tar.bz2 |
Changes to force odict use UTF8 encoding. Please report if it cause problems with older dictionary files.
-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp index ef36ee5..3eb1e45 100644 --- a/noncore/apps/odict/dingwidget.cpp +++ b/noncore/apps/odict/dingwidget.cpp | |||
@@ -34,16 +34,17 @@ void DingWidget::loadDict( QString name ) | |||
34 | 34 | ||
35 | Config cfg( "odict" ); | 35 | Config cfg( "odict" ); |
36 | cfg.setGroup( "Method_" + name ); | 36 | cfg.setGroup( "Method_" + name ); |
37 | QFile file( cfg.readEntry( "file" ) ); | 37 | QFile file( cfg.readEntry( "file" ) ); |
38 | 38 | ||
39 | if( file.open( IO_ReadOnly ) ) | 39 | if( file.open( IO_ReadOnly ) ) |
40 | { | 40 | { |
41 | QTextStream stream( &file ); | 41 | QTextStream stream( &file ); |
42 | stream.setEncoding(QTextStream::UnicodeUTF8); | ||
42 | while ( !stream.eof() ) | 43 | while ( !stream.eof() ) |
43 | { | 44 | { |
44 | lines.append( stream.readLine() ); | 45 | lines.append( stream.readLine() ); |
45 | } | 46 | } |
46 | file.close(); | 47 | file.close(); |
47 | } | 48 | } |
48 | 49 | ||
49 | setDict( name ); | 50 | setDict( name ); |