Bug: 195932560

Clone this repo:
  1. d0f3965 Make cesu8 available to product and vendor am: f67f58991a by Matthew Maurer · 3 months ago main master android-u-beta-1-gpl
  2. f67f589 Make cesu8 available to product and vendor by Matthew Maurer · 3 months ago
  3. f5a058e Merge "Update TEST_MAPPING" am: cad1f726a8 am: bb6fa3c792 am: 22b87a81e0 am: c2da52e2c5 by Treehugger Robot · 12 months ago main-16k-with-phones
  4. c2da52e Merge "Update TEST_MAPPING" am: cad1f726a8 am: bb6fa3c792 am: 22b87a81e0 by Treehugger Robot · 12 months ago
  5. 22b87a8 Merge "Update TEST_MAPPING" am: cad1f726a8 am: bb6fa3c792 by Treehugger Robot · 12 months ago main-16k

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.