commit | 6e441525c01217b2ed15402ec80e217980849b4e | [log] [tgz] |
---|---|---|
author | Andrew Walbran <qwandor@google.com> | Wed Nov 08 22:49:53 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Nov 08 22:49:53 2023 +0000 |
tree | 6a72bdf24002eb4d64ecc8ef72f5c9c4559c3b19 | |
parent | 51654092fd33c89d1a954ea0089d139a0b13b912 [diff] | |
parent | c6dc74b02f2e0045fc4a82ca908dc2108863e573 [diff] |
Migrate to cargo_embargo. am: 2b68c7ca5a am: 279eca3c46 am: c6dc74b02f Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cesu8/+/2822395 Change-Id: Ibb06d146538b73045a660f0070b90a8c58c7a131 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.