commit | 98e80336ce107f17f382b1f5a528fae20a80f130 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Feb 15 19:37:24 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Feb 15 19:37:24 2024 +0000 |
tree | 6a72bdf24002eb4d64ecc8ef72f5c9c4559c3b19 | |
parent | 4946669c8808336e8ae5c840f057594ef451fb29 [diff] | |
parent | d149778150d845cf2f1cf086dc1eff3507d70b70 [diff] |
Snap for 11451325 from d149778150d845cf2f1cf086dc1eff3507d70b70 to aml-frc-release Change-Id: I81a3cb9f24ee593640235dab6467a754dbebc8a9
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.