File: 0028-Ensure-we-throw-away-the-BOM-in-the-qversitreader-te.patch

package info (click to toggle)
qtpim-opensource-src 5.0~git20201102.f9a8f0fc%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,540 kB
  • sloc: cpp: 82,710; xml: 91; makefile: 86; javascript: 67
file content (34 lines) | stat: -rw-r--r-- 1,478 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 9bcae917730ce083ebb3d45392a4b8ccf57ee306 Mon Sep 17 00:00:00 2001
From: Chris Adams <chris.adams@qinetic.com.au>
Date: Fri, 5 Mar 2021 15:49:16 +1000
Subject: [PATCH 38/44] Ensure we throw away the BOM in the qversitreader test

The BOM will only be emitted from the very first call to
encoder->fromUnicode(), and thus since we compare the output from
one invocation to the output of another, we need to ensure that
the BOM is not included in the result of either.

However, previously we attempted to do this by passing a null
QString into fromUnicode(), however it seems that now it ignores
such input.  Hence, we need to give it some dummy input in the
first call to fromUnicode() to force it to "spend" its BOM output.

Change-Id: I74d8bd53604044ba1e82d48668d9570505fef491
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Rebased against kde/5.15: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 tests/auto/versit/qversitreader/tst_qversitreader.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tests/auto/versit/qversitreader/tst_qversitreader.cpp
+++ b/tests/auto/versit/qversitreader/tst_qversitreader.cpp
@@ -1850,7 +1850,7 @@
 
     QTextCodec* codec = QTextCodec::codecForName(codecName);
     QTextEncoder* encoder = codec->makeEncoder();
-    encoder->fromUnicode(QString());
+    encoder->fromUnicode(QString("ignore BOM"));
 
     QByteArray bytes(encoder->fromUnicode(data));