commit | d40253cacb46bd0d6523a1637631c749f93c138c | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Mon Nov 29 14:03:14 2021 -0800 |
committer | Joel Galenson <jgalenson@google.com> | Fri Dec 10 15:32:30 2021 -0800 |
tree | ca9ba939281ce1cdb13491031e734ceb300d9940 | |
parent | 206ec4cb2f9a4c172bf1a1e6da62ee751612bc4d [diff] |
Refresh Android.bp, cargo2android.json, TEST_MAPPING. Test: None Change-Id: I9a60caa02488aa4161ae5dde6962fa18bbca6457
Convert between ordinary UTF-8 and CESU-8 encodings.
CESU-8 encodes characters outside the Basic Multilingual Plane as two UTF-16 surrogate chacaters, which are then further re-encoded as invalid, 3-byte UTF-8 characters. This means that 4-byte UTF-8 sequences become 6-byte CESU-8 sequences.
Note that CESU-8 is only intended for internal use within tightly-coupled systems, and not for data interchange.
This encoding is sometimes needed when working with Java, Oracle or MySQL, and when trying to store emoji, hieroglyphs, or other characters on the Supplementary Multilingual Plane or the Supplementary Ideographic Plane.
Some of this code is adapted from Rust's src/libcore/str.rs
file. This code is covered by LICENSE-RUST.txt and copyright by The Rust Project Developers and individual Rust contributors, as described in that file.
The new code in this project is distributed under the same terms.