Changed AAPT2 to abide by AAPT resource whitespace triming.
Bug: b/74331008
Test: Created tests in ResourceParser_test.cpp
Change-Id: Id7b387692b795774cd77452ca8cf06a8447bf3be
(cherry picked from commit a04880771254f5169a1fe460ff40b565d9dceb0d)
diff --git a/tools/aapt2/ResourceUtils.cpp b/tools/aapt2/ResourceUtils.cpp
index 8fc3d65..560077c 100644
--- a/tools/aapt2/ResourceUtils.cpp
+++ b/tools/aapt2/ResourceUtils.cpp
@@ -30,7 +30,6 @@
#include "util/Files.h"
#include "util/Util.h"
-using ::aapt::text::IsWhitespace;
using ::aapt::text::Utf8Iterator;
using ::android::StringPiece;
using ::android::StringPiece16;
@@ -807,7 +806,7 @@
Utf8Iterator iter(text);
while (iter.HasNext()) {
char32_t codepoint = iter.Next();
- if (!quote_ && text::IsWhitespace(codepoint)) {
+ if (!quote_ && iswspace(codepoint)) {
if (!last_codepoint_was_space_) {
// Emit a space if it's the first.
xml_string_.text += ' ';