tag | 9bef776d3bf1fbfd300273cf867cef1c75526569 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Wed Apr 12 14:24:57 2023 -0700 |
object | d0f3965f396654f76fd6eb8dc59b6e15c0f292e1 |
Android U Beta 1 GPL
commit | d0f3965f396654f76fd6eb8dc59b6e15c0f292e1 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Thu Mar 09 15:13:40 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Mar 09 15:13:40 2023 +0000 |
tree | 87b5f7bf87edcd74f46de24857666715bfcae5c7 | |
parent | f5a058e8c5abfc7c8f0faf42f9fa48b1490a0a02 [diff] | |
parent | f67f58991a996b64f1d768f7c2b8a5abf31a1608 [diff] |
Make cesu8 available to product and vendor am: f67f58991a Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cesu8/+/2476329 Change-Id: I1e8809246845f3596c608190a8279606c8f70a42 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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.