diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-01-10 20:53:36 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-01-12 05:05:02 +0200 |
commit | f090a4785b99573dd5a506fec655df1abe347e7c (patch) | |
tree | 9ca8e70cb8b917a33dae036c3c047aa03832fe63 /src/corelib/text/qstring.cpp | |
parent | 92a7c360208c6ab7504e8ff9e091fede73839fb1 (diff) |
QStringConverter: use qt_to_latin1() helper from qstring.cpp
This changes the newly-added QLatin1::convertFromUnicode() overload.
Change-Id: Ie465f052e711d72e51217b74b5b51a89c5d8b9e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 5de3043c69..9259d485c1 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -5389,6 +5389,12 @@ char16_t *QLatin1::convertToUnicode(char16_t *out, QLatin1StringView in) noexcep return std::next(out, len); } +char *QLatin1::convertFromUnicode(char *out, QStringView in) noexcept +{ + const qsizetype len = in.size(); + qt_to_latin1(reinterpret_cast<uchar *>(out), in.utf16(), len); + return out + len; +} /*! \fn QByteArray QString::toLatin1() const |