Skip to content

Commit

Permalink
opt: remove gls qtextcodec (#2058)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang authored Jan 3, 2025
1 parent 7bea83e commit 62e7d42
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/dict/gls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <QByteArray>
#include <QDir>
#include <QRegularExpression>
#include <QtCore5Compat/QTextCodec>
#include <string>
#include <list>
#include <map>
Expand Down Expand Up @@ -51,7 +50,6 @@ class GlsScanner
{
gzFile f;
Encoding encoding;
QTextCodec * codec;
std::u32string dictionaryName;
std::u32string dictionaryDecription, dictionaryAuthor;
std::u32string langFrom, langTo;
Expand Down Expand Up @@ -171,7 +169,6 @@ GlsScanner::GlsScanner( string const & fileName ):
encoding = Encoding::Utf8;
}

codec = QTextCodec::codecForName( Text::getEncodingNameFor( encoding ) );
// We now can use our own readNextLine() function
lineFeed = Text::initLineFeed( encoding );

Expand Down Expand Up @@ -257,7 +254,8 @@ bool GlsScanner::readNextLine( std::u32string & out, size_t & offset )
if ( pos == -1 ) {
return false;
}
QString line = codec->toUnicode( readBufferPtr, pos );

QString line = Iconv::toQString( Text::getEncodingNameFor( encoding ), readBufferPtr, pos );

line = Utils::rstrip( line );

Expand Down

0 comments on commit 62e7d42

Please sign in to comment.