From c3477a7375618d7a0271600082e37e461a2a3eb3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 18 Jul 2024 11:22:26 +0200 Subject: [PATCH] [docs] qvsnprint(): mention %a and %ls differences on WASM/Android Pick-to: 6.7 6.5 6.2 Task-number: QTBUG-127110 Change-Id: I919170881846f3a08890ac0a8accfb859157d193 Reviewed-by: Volker Hilsheimer (cherry picked from commit 1aedd4d7c9968054a1c2880000a5007bb826a179) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/text/qvsnprintf.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/text/qvsnprintf.cpp b/src/corelib/text/qvsnprintf.cpp index 1a3dc2e1f95..dd988161d53 100644 --- a/src/corelib/text/qvsnprintf.cpp +++ b/src/corelib/text/qvsnprintf.cpp @@ -30,7 +30,9 @@ QT_BEGIN_NAMESPACE \warning Since vsnprintf() shows different behavior on certain platforms, you should not rely on the return value or on the fact - that you will always get a 0 terminated string back. + that you will always get a 0 terminated string back. There are also + differences in how \c{%a} (hex floats) and \c{%ls} (wide strings) are + handled on WebAssembly and Android. Ideally, you should never call this function but use QString::asprintf() instead.