diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-03-07 15:06:33 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-12 18:13:37 +0100 |
commit | 4d2bf663ebca19402fda5527535b93d5cdde6e27 (patch) | |
tree | f65326067a7e1339fc695487afd16e524b282e0e | |
parent | b7155b6c07b76d802b15dea8eb5aca4085b0d10d (diff) |
interpret format argument of QString::sprintf() as UTF-8
we expect our source code to be utf-8 throughout, so it doesn't make
sense to expect the specifier to be latin-1, as that limits the
effective charset to ascii.
Change-Id: I22335509ba6c5805d8b264cfd01d7f9a4cf7ef76
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r-- | src/corelib/tools/qstring.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 75ef07a96e..eb8750838b 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -5461,8 +5461,10 @@ QString &QString::vsprintf(const char* cformat, va_list ap) const char *c = cformat; for (;;) { // Copy non-escape chars to result + const char *cb = c; while (*c != '\0' && *c != '%') - result.append(QLatin1Char(*c++)); + c++; + result.append(QString::fromUtf8(cb, (int)(c - cb))); if (*c == '\0') break; |