summaryrefslogtreecommitdiff
path: root/include/utils/String16.h
diff options
context:
space:
mode:
author Kenny Root <kroot@google.com> 2009-12-04 09:38:48 -0800
committer Kenny Root <kroot@google.com> 2009-12-07 15:14:15 -0800
commit92f5984d2c2cd73b6b9f68c02c147877d1e2fc46 (patch)
treefa3930192e29c22b91af41ba4b20adf4286b2217 /include/utils/String16.h
parentbd3b0114893ed5fc24fd92955f59354b838041e1 (diff)
Optional use of UTF-8 strings in resource bundles
Allows the use of UTF-8 for packing resources instead of the default of UTF-16 for Java. When strings are extracted from the ResStringPool, they are converted to UTF-16 and the result is cached for subsequent calls. When using aapt to package, add in the "-8" switch to pack the resources using UTF-8. This will result in the value, key, and type strings as well as the compiled XML string values taking significantly less space in the final application package in most scenarios. Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
Diffstat (limited to 'include/utils/String16.h')
-rw-r--r--include/utils/String16.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/utils/String16.h b/include/utils/String16.h
index a2d22eea9a..07a0c1188e 100644
--- a/include/utils/String16.h
+++ b/include/utils/String16.h
@@ -49,12 +49,17 @@ int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2);
// Version of strzcmp16 for comparing strings in different endianness.
int strzcmp16_h_n(const char16_t *s1H, size_t n1, const char16_t *s2N, size_t n2);
+// Convert UTF-8 to UTF-16 including surrogate pairs
+void utf8_to_utf16(const uint8_t *src, size_t srcLen, char16_t* dst, const size_t dstLen);
+
}
// ---------------------------------------------------------------------------
namespace android {
+// ---------------------------------------------------------------------------
+
class String8;
class TextOutput;