summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-02-28 21:40:43 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-03-02 12:51:14 +0100
commit349bd4db22d057f3fc633f5522c53ad0bfb7bd6f (patch)
tree337cb6d73a3c30327440e61f1dfbcb4409cc3288 /src/corelib/text
parente7d038c027c3fd80f7f6714df3d6e1a5bb7b4968 (diff)
Document that to/FromLocal8Bit() does not consider CFStringGetSystemEncoding
The CFStringGetSystemEncoding() defaults to Mac Roman, unless overridden via ~/.CFUserTextEncoding, which very few users do or even know about. Make a note in the to/FromLocal8Bit() that we don't consult this function, or its NSString wrapper, when determining what the local 8 bit encoding is. Task-number: QTBUG-111443 Change-Id: I89b6040c62d42de0daea9df908d97d9a23e7b160 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/corelib/text')
-rw-r--r--src/corelib/text/qstring.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 2d9840fb5d..248d9e7b8e 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -5457,8 +5457,7 @@ static QByteArray qt_convert_to_local_8bit(QStringView string);
QByteArray. The returned byte array is undefined if the string
contains characters not supported by the local 8-bit encoding.
- On Unix systems this is equivalent to toUtf8(), on Windows the systems
- current code page is being used.
+ \include qstring.qdocinc {qstring-local-8-bit-equivalent} {toUtf8}
If this string contains any characters that cannot be encoded in the
locale, the returned byte array is undefined. Those characters may be
@@ -5655,8 +5654,7 @@ QString QString::fromLatin1(QByteArrayView ba)
If \a size is \c{-1}, \c{strlen(str)} is used instead.
- On Unix systems this is equivalent to fromUtf8(), on Windows the systems
- current code page is being used.
+ \include qstring.qdocinc {qstring-local-8-bit-equivalent} {fromUtf8}
\sa toLocal8Bit(), fromLatin1(), fromUtf8()
*/
@@ -5668,6 +5666,8 @@ QString QString::fromLatin1(QByteArrayView ba)
Returns a QString initialized with the 8-bit string \a str.
+ \include qstring.qdocinc {qstring-local-8-bit-equivalent} {fromUtf8}
+
\note: any null ('\\0') bytes in the byte array will be included in this
string, converted to Unicode null characters (U+0000). This behavior is
different from Qt 5.x.
@@ -5680,6 +5680,8 @@ QString QString::fromLatin1(QByteArrayView ba)
Returns a QString initialized with the 8-bit string \a str.
+ \include qstring.qdocinc {qstring-local-8-bit-equivalent} {fromUtf8}
+
\note: any null ('\\0') bytes in the byte array will be included in this
string, converted to Unicode null characters (U+0000).
*/