From 5e3617bef5bc7e4c98fb63514471c49800feef03 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 6 Mar 2017 11:20:25 +0100 Subject: Fix lupdate to handle \u escapes It treated \u as u, which isn't correct. Instead, read the number following and convert, via QChar, to UTF-8 encoding in the byte array (that'll later be .fromUtf8()ed). Added a simple test-case. Task-number: QTBUG-35164 Change-Id: Ib23cc5e5fb98e6cb8715b4018545e40a40e271d0 Reviewed-by: Oswald Buddenhagen --- tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp | 8 ++++++++ .../linguist/lupdate/testdata/good/parsecpp/project.ts.result | 6 ++++++ 2 files changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp index 3f3a99c48..1bc1dc2a2 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp @@ -647,3 +647,11 @@ QObject::tr("message after system include without space"); #include"qobject.h" QObject::tr("message after local include without space"); + + + +// QTBUG-35164: handling of \uNNNN escapes +QString unicodeEscape() +{ + return QApplication::tr("Context", "soft\u00ADhyphen"); +} diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result index 683c2aef3..c344667cf 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -295,6 +295,12 @@ backslashed \ stuff. Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. + + + Context + soft­hyphen + + QCoreApplication -- cgit v1.2.1