commit | 9fdfd7d9f46b00519cccc0887b8f4e5c73f4cb3a | [log] [tgz] |
---|---|---|
author | James Farrell <jamesfarrell@google.com> | Thu Aug 15 01:50:59 2024 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Aug 15 01:50:59 2024 +0000 |
tree | 8c6e533f408142fb3936be3e46992b8265386496 | |
parent | 553993eb332ba470e973378f2727bfea92520528 [diff] | |
parent | 366bd896ddb43076ebc6bfb27094425b36eb0fd7 [diff] |
Migrate 25 crates to monorepo am: 366bd896dd Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cesu8/+/3217318 Change-Id: I2deb21f2c46c8f9d3e2ec36486a66c9f0abf019c 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.