OSDN Git Service

AAPT2: Iterate over UTF-8 string by codepoints
authorAdam Lesinski <adamlesinski@google.com>
Wed, 28 Jun 2017 01:39:07 +0000 (18:39 -0700)
committerAdam Lesinski <adamlesinski@google.com>
Fri, 30 Jun 2017 01:17:35 +0000 (18:17 -0700)
commit549e437e14f3b92f02bd3abc7d1cd68387132ce1
treeb7f1e2089d81ad530b1e78914ad97bdedfeaa9c7
parent2fa4a346ecea162d3e694c2c53582f3cc31bcc68
AAPT2: Iterate over UTF-8 string by codepoints

Iterating over a UTF-8 string by codepoints ensures that
unicode characters do not get sliced. Otherwise the resulting
string could contain malformed characters.

Bug: 62839202
Test: make aapt2_tests
Change-Id: Ia0c44fbceb7dcfa11e77a1a77011da0f5466e342
tools/aapt2/Android.bp
tools/aapt2/ResourceParser_test.cpp
tools/aapt2/readme.md
tools/aapt2/util/Utf8Iterator.cpp [new file with mode: 0644]
tools/aapt2/util/Utf8Iterator.h [new file with mode: 0644]
tools/aapt2/util/Utf8Iterator_test.cpp [new file with mode: 0644]
tools/aapt2/util/Util.cpp