From 14908ad4c69252cb0af0256624f970d5743be80a Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 9 Jan 2021 02:17:21 +0200 Subject: [PATCH] copy the result of nl_langinfo() Signed-off-by: Ivailo Monev --- src/core/codecs/qtextcodec.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.11.0