diff --git a/iconv.cc b/iconv.cc index c266440e..b534fda2 100644 --- a/iconv.cc +++ b/iconv.cc @@ -26,8 +26,10 @@ Iconv::~Iconv() QString Iconv::convert(void const* & inBuf, size_t& inBytesLeft) { - return codec->toUnicode(static_cast(inBuf), inBytesLeft); - + if( codec ) + 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,