summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceParser_test.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2019-03-11 11:00:25 -0700
committerRyan Mitchell <rtmitchell@google.com>2019-03-11 11:00:25 -0700
commit0f3267590980bccd39f2d954320aa97cf1901c0b (patch)
tree2c265050794cdf04c8d3c7aa0d7c0b259a47958e /tools/aapt2/ResourceParser_test.cpp
parent41469c3b522f28c4590398ad6e35193b2142dda7 (diff)
Do not convert whitespace chars above max char to regular space
Using isspace and iswspace on characters above the maximum char value is undefined. This change makes aapt2 use isspace like aapt and only trims whitespace characters at or below the maximum char value like aapt2. Bug: 121017795 Test: aapt2_tests Change-Id: I015e4b77f0ff53e409e880fcf9ae104ba3444d1a
Diffstat (limited to 'tools/aapt2/ResourceParser_test.cpp')
-rw-r--r--tools/aapt2/ResourceParser_test.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/aapt2/ResourceParser_test.cpp b/tools/aapt2/ResourceParser_test.cpp
index 251ca0c9256e..53361414e9b8 100644
--- a/tools/aapt2/ResourceParser_test.cpp
+++ b/tools/aapt2/ResourceParser_test.cpp
@@ -183,11 +183,11 @@ TEST_F(ResourceParserTest, ParseStringTruncateASCII) {
EXPECT_THAT(str->untranslatable_sections, IsEmpty());
// Preserve non-ASCII whitespace including extended ASCII characters
- EXPECT_TRUE(TestParse(R"(<string name="foo3">&#160;Hello&#160;</string>)"));
+ EXPECT_TRUE(TestParse(R"(<string name="foo3">&#160;Hello&#x202F;World&#160;</string>)"));
str = test::GetValue<String>(&table_, "string/foo3");
ASSERT_THAT(str, NotNull());
- EXPECT_THAT(*str->value, StrEq("\xC2\xA0Hello\xC2\xA0"));
+ EXPECT_THAT(*str->value, StrEq("\xC2\xA0Hello\xE2\x80\xAFWorld\xC2\xA0"));
EXPECT_THAT(str->untranslatable_sections, IsEmpty());
EXPECT_TRUE(TestParse(R"(<string name="foo4">2005年6月1日</string>)"));