fix:bgl encoding convert exception

This commit is contained in:
Xiao YiFang 2023-01-24 21:07:24 +08:00
parent bc2a64f94c
commit e4595fb6d9

View file

@ -26,8 +26,10 @@ Iconv::~Iconv()
QString Iconv::convert(void const* & inBuf, size_t& inBytesLeft) QString Iconv::convert(void const* & inBuf, size_t& inBytesLeft)
{ {
if( codec )
return codec->toUnicode( static_cast< const char * >( inBuf ), inBytesLeft ); return codec->toUnicode( static_cast< const char * >( inBuf ), inBytesLeft );
QByteArray ba( static_cast< const char * >( inBuf ), inBytesLeft );
return QString( ba );
} }
gd::wstring Iconv::toWstring( char const * fromEncoding, void const * fromData, gd::wstring Iconv::toWstring( char const * fromEncoding, void const * fromData,