diff options
Diffstat (limited to 'tools/aapt2/flatten/TableFlattener.cpp')
-rw-r--r-- | tools/aapt2/flatten/TableFlattener.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/aapt2/flatten/TableFlattener.cpp b/tools/aapt2/flatten/TableFlattener.cpp index 28a792820de3..5fbb0fec7256 100644 --- a/tools/aapt2/flatten/TableFlattener.cpp +++ b/tools/aapt2/flatten/TableFlattener.cpp @@ -25,6 +25,7 @@ #include <android-base/macros.h> #include <algorithm> +#include <sstream> #include <type_traits> #include <numeric> @@ -231,7 +232,8 @@ public: } // Copy the package name in device endianness. - strcpy16_htod(pkgHeader->name, arraysize(pkgHeader->name), mPackage->name); + strcpy16_htod(pkgHeader->name, arraysize(pkgHeader->name), + util::utf8ToUtf16(mPackage->name)); // Serialize the types. We do this now so that our type and key strings // are populated. We write those first. @@ -423,9 +425,9 @@ private: // If there is a gap in the type IDs, fill in the StringPool // with empty values until we reach the ID we expect. while (type->id.value() > expectedTypeId) { - std::u16string typeName(u"?"); - typeName += expectedTypeId; - mTypePool.makeRef(typeName); + std::stringstream typeName; + typeName << "?" << expectedTypeId; + mTypePool.makeRef(typeName.str()); expectedTypeId++; } expectedTypeId++; |