OSDN Git Service
(root)
/
kde
/
Katie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1dc88a3
)
deep-copy the charset name in QTextCodec::codecForText()
author
Ivailo Monev
<xakepa10@gmail.com>
Tue, 1 Nov 2022 03:36:48 +0000
(
05:36
+0200)
committer
Ivailo Monev
<xakepa10@gmail.com>
Tue, 1 Nov 2022 03:36:48 +0000
(
05:36
+0200)
it is documented to remain valid as long as UCharsetMatch is
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/codecs/qtextcodec.cpp
patch
|
blob
|
history
diff --git
a/src/core/codecs/qtextcodec.cpp
b/src/core/codecs/qtextcodec.cpp
index
a8e6f71
..
b9bc2de
100644
(file)
--- a/
src/core/codecs/qtextcodec.cpp
+++ b/
src/core/codecs/qtextcodec.cpp
@@
-1783,14
+1783,14
@@
QTextCodec *QTextCodec::codecForText(const QByteArray &ba, QTextCodec *defaultCo
}
error = U_ZERO_ERROR;
- const
char *
name = ucsdet_getName(match, &error);
+ const
QByteArray
name = ucsdet_getName(match, &error);
if (Q_UNLIKELY(U_FAILURE(error))) {
ucsdet_close(detector);
return defaultCodec;
}
ucsdet_close(detector);
- return QTextCodec::codecForName(name);
+ return QTextCodec::codecForName(name
.constData()
);
}
/*!