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>bb10
parent
b7155b6c07
commit
4d2bf663eb
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue