From 1baf60d18cfb77730b60fd725e9c65d306149971 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 7 May 2020 00:06:40 +0200 Subject: QFontDatabase: store Vietnamese writingSystemSample() in UTF-16 The old code stored it in UTF-8 with an encoded BOM. Using the new QString::op+=(QStringView), we can store the string, without the BOM, in ten instead of 15 bytes. Change-Id: Ia1c51da523fcd6298b39bf2ec162a49c7cfdda63 Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/gui/text/qfontdatabase.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/gui/text/qfontdatabase.cpp') diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 75a0171aab..c511ec897b 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -2213,16 +2213,8 @@ QString QFontDatabase::writingSystemSample(WritingSystem writingSystem) sample += QChar(0xac2f); break; case Vietnamese: - { - static const char vietnameseUtf8[] = { - char(0xef), char(0xbb), char(0xbf), char(0xe1), char(0xbb), char(0x97), - char(0xe1), char(0xbb), char(0x99), - char(0xe1), char(0xbb), char(0x91), - char(0xe1), char(0xbb), char(0x93), - }; - sample += QString::fromUtf8(vietnameseUtf8, sizeof(vietnameseUtf8)); + sample += u"\x1ED7\x1ED9\x1ED1\x1ED3"; break; - } case Ogham: sample += QChar(0x1681); sample += QChar(0x1682); -- cgit v1.2.3