Bug: 195932560

Clone this repo:
  1. 9fdfd7d Migrate 25 crates to monorepo am: 366bd896dd by James Farrell · 8 weeks ago main master
  2. 366bd89 Migrate 25 crates to monorepo by James Farrell · 8 weeks ago main-16k
  3. 553993e Update Android.bp by running cargo_embargo am: 7ebe55f85d by James Farrell · 9 weeks ago
  4. 7ebe55f Update Android.bp by running cargo_embargo by James Farrell · 10 weeks ago
  5. 334df03 Cleanup license metadata in external/rust/crates/cesu8. am: 1352fb3172 by Wei Li · 2 months ago

CESU-8 encoder/decoder for Rust

Build Status Latest version License

Documentation.

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.

License

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.