commit | 72c13873b44b1526afbf4d9726054a58b16a35b5 | [log] [tgz] |
---|---|---|
author | Bob Badour <bbadour@google.com> | Fri Aug 27 11:31:25 2021 -0700 |
committer | Bob Badour <bbadour@google.com> | Fri Aug 27 11:31:25 2021 -0700 |
tree | e78c86f0d881751c49a350b7b4f62f816827461a | |
parent | 5f00ca1f798cb46c8b0659e149980ec58c9e2f53 [diff] |
[LSC] Add LOCAL_LICENSE_KINDS to external/rust/crates/cesu8 Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT SPDX-license-identifier-NCSA legacy_unencumbered to: Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: Ib06c768189c78e8265daf33c6f7ade9d6584d56e
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.