From 4fb6516a55604bfbae2e8b1411e1bdd27df1866f Mon Sep 17 00:00:00 2001 From: Igor Viarheichyk Date: Thu, 6 Jul 2017 15:23:51 -0700 Subject: Improved word break for BiDi pseudolocalizer. Characted sequences \n and \t are now treated as word separators by BiDi pseudolocalizer. This solves issues when text rendering engine breaks a line in the middle of a text chunk marked with RLM+RLO and PDF+RLM sequences. Bug:34064580 Change-Id: I52e6018785fae25479fa167440f24c534b0e3253 Fixes:34064580 Test: make aapt2_tests Test: Run aapt2_tests binary --- tools/aapt/pseudolocalize.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tools/aapt/pseudolocalize.cpp') diff --git a/tools/aapt/pseudolocalize.cpp b/tools/aapt/pseudolocalize.cpp index c7fee2c19342..5c47e0fa8a16 100644 --- a/tools/aapt/pseudolocalize.cpp +++ b/tools/aapt/pseudolocalize.cpp @@ -360,9 +360,15 @@ String16 PseudoMethodBidi::text(const String16& source) String16 result; bool lastspace = true; bool space = true; + bool escape = false; + const char16_t ESCAPE_CHAR = '\\'; for (size_t i=0; i