From c5cb2b2ce05ad23fb4daef3c7e0f3a2b6be704cb Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Fri, 3 Jan 2025 14:37:21 +0800 Subject: [PATCH] opt: remove gls qtextcodec --- src/dict/gls.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dict/gls.cc b/src/dict/gls.cc index 02eb8c4b6..e74fc9a29 100644 --- a/src/dict/gls.cc +++ b/src/dict/gls.cc @@ -169,7 +169,6 @@ GlsScanner::GlsScanner( string const & fileName ): encoding = Encoding::Utf8; } - auto encoding = Text::getEncodingNameFor( encoding ); // We now can use our own readNextLine() function lineFeed = Text::initLineFeed( encoding ); @@ -255,7 +254,8 @@ bool GlsScanner::readNextLine( std::u32string & out, size_t & offset ) if ( pos == -1 ) { return false; } - QString line = Iconv::toQString( encoding, readBufferPtr, pos ); + + QString line = Iconv::toQString( Text::getEncodingNameFor( encoding ), readBufferPtr, pos ); line = Utils::rstrip( line );