From 2b5be0cb1df3fe72685af85f19ca56748077ea81 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Sat, 4 Jan 2025 14:02:36 +0800 Subject: [PATCH] opt: remove qtextcodec --- src/dict/epwing_book.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/dict/epwing_book.cc b/src/dict/epwing_book.cc index bec302463..99cba97db 100644 --- a/src/dict/epwing_book.cc +++ b/src/dict/epwing_book.cc @@ -174,15 +174,12 @@ hook_narrow_jisx0208( EB_Book * book, EB_Appendix *, void * container, EB_Hook_C if ( out_code == 0 ) { EContainer * cont = static_cast< EContainer * >( container ); - if ( cont->book->codec_Euc_name ) { - QByteArray str = Iconv::toQString( cont->book->codec_Euc_name, (const char *)buf, 2 ).toUtf8(); - eb_write_text( book, str.data(), str.size() ); - } - else - eb_write_text( book, (const char *)buf, 2 ); + QByteArray str = Iconv::toQString( cont->book->codec_Euc_name, (const char *)buf, 2 ).toUtf8(); + eb_write_text( book, str.data(), str.size() ); } - else + else { eb_write_text_byte1( book, out_code ); + } } return EB_SUCCESS;