diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-04-30 10:30:40 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-05-14 07:48:55 +0200 |
commit | 13af1312f7416dd23baf512dcb9e51dce3d936fc (patch) | |
tree | 64ec3db34cc4df585724ec7ca9d2c91f7915ed60 /src/corelib/text/qstringconverter.h | |
parent | a639bcda1e42f48fa32885ede77f9fd320ce731c (diff) |
Add QStringConverter::encodingForData()
Add method that tries to determine the encoding of the data
from an initial byte order mark.
Change-Id: I348c51a3d4db9b434af53359b739a7e17acfc760
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstringconverter.h')
-rw-r--r-- | src/corelib/text/qstringconverter.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/text/qstringconverter.h b/src/corelib/text/qstringconverter.h index fe401ecc9e..6269ace4ac 100644 --- a/src/corelib/text/qstringconverter.h +++ b/src/corelib/text/qstringconverter.h @@ -167,6 +167,7 @@ public: Q_CORE_EXPORT static std::optional<Encoding> encodingForName(const char *name); Q_CORE_EXPORT static const char *nameForEncoding(Encoding e); + Q_CORE_EXPORT static std::optional<Encoding> encodingForData(const char *buf, qsizetype arraySize, char16_t expectedFirstCharacter = 0); protected: const Interface *iface; |