| commit | bf620bb5f2fbd519dc45100da7edcd62db4b756f | [log] [tgz] |
|---|---|---|
| author | Matthew Maurer <[email protected]> | Thu Mar 09 17:05:22 2023 +0000 |
| committer | Automerger Merge Worker <[email protected]> | Thu Mar 09 17:05:22 2023 +0000 |
| tree | 87b5f7bf87edcd74f46de24857666715bfcae5c7 | |
| parent | 3189365bcc97bd9be18dcdd65cf6835eac193e73 [diff] | |
| parent | 5ea1e8d6836e89d8007e3f744ba42c5ddf55f6de [diff] |
Make cesu8 available to product and vendor am: f67f58991a am: d0f3965f39 am: 5ea1e8d683 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cesu8/+/2476329 Change-Id: I69067936f488b006fa51d99aefedb3a787e9eaa1 Signed-off-by: Automerger Merge Worker <[email protected]>
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.