diff options
Diffstat (limited to 'tools/aapt/Resource.cpp')
-rw-r--r-- | tools/aapt/Resource.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index c0ebb59..87f2420 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -226,7 +226,7 @@ static status_t parsePackage(Bundle* bundle, const sp<AaptAssets>& assets, if (minSdkIndex >= 0) { const uint16_t* minSdk16 = block.getAttributeStringValue(minSdkIndex, &len); const char* minSdk8 = strdup(String8(minSdk16).string()); - bundle->setMinSdkVersion(minSdk8); + bundle->setManifestMinSdkVersion(minSdk8); } } } @@ -768,7 +768,13 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets) // Standard flags for compiled XML and optional UTF-8 encoding int xmlFlags = XML_COMPILE_STANDARD_RESOURCE; - if (bundle->getUTF8()) { + + /* Only enable UTF-8 if the caller of aapt didn't specifically + * request UTF-16 encoding and the parameters of this package + * allow UTF-8 to be used. + */ + if (!bundle->getWantUTF16() + && bundle->isUTF8Available()) { xmlFlags |= XML_COMPILE_UTF8; } |