From: Ivailo Monev Date: Sat, 9 Jan 2021 00:17:21 +0000 (+0200) Subject: copy the result of nl_langinfo() X-Git-Tag: 4.12.0~2788 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=14908ad4c69252cb0af0256624f970d5743be80a;p=kde%2FKatie.git copy the result of nl_langinfo() Signed-off-by: Ivailo Monev --- diff --git a/src/core/codecs/qtextcodec.cpp b/src/core/codecs/qtextcodec.cpp index dd16d766c..ac4cb8e75 100644 --- a/src/core/codecs/qtextcodec.cpp +++ b/src/core/codecs/qtextcodec.cpp @@ -190,8 +190,8 @@ static void setupLocaleMapper() } if (!localeMapper) { - const char *charset = ::nl_langinfo(CODESET); - if (charset) + const QByteArray charset = ::nl_langinfo(CODESET); + if (!charset.isEmpty()) localeMapper = QTextCodec::codecForName(charset); }