commit | 091328ad0ebd728eb4df81b9684042c9a905c117 | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Tue Nov 09 16:28:16 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Nov 09 16:28:16 2021 +0000 |
tree | 54d6d989f49b2aa65c0ecd205b0ec6b2e8f526e3 | |
parent | 2d25ba10cfe9abc832532205ffdc29468d8ae748 [diff] | |
parent | 7ae2d05fddfefc672cd3993de76593c0959c9200 [diff] |
Add apex_available. am: 206ec4cb2f am: 37f329d9f5 am: f18005fca8 am: 7ae2d05fdd Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cesu8/+/1874165 Change-Id: I75d2ed3efe7645c45e99ae390964405a619db1ea
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.