zwnbsp 0.0.1

Zero width no-breaking space character utilities for Unicode and HTML
Documentation
  • Coverage
  • 80%
    8 out of 10 items documented1 out of 1 items with examples
  • Size
  • Source code size: 12.96 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 867.36 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • LeoBorai/zwnbsp
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • LeoBorai

zwnbsp

Create zero-width text representations from ASCII text for Unicode and HTML.

zwnbsp crate contains utilities to parse strings from ASCII to a zero-width representation of this data. Currently the library supports Unicode and HTML outputs.

Create Unicode representation in zero width characters for "Rustaceans"

use zwnbsp::ZeroWidth;

let zero_width = ZeroWidth::new("Rustaceans").unwrap().to_unicode();
let unicode_representation = "\u{200c}\u{200b}\u{200c}\u{200b}\u{200c}\u{200b}\u{200b}\u{200c}\u{200b}\u{200c}\u{200d}\u{200c}\u{200b}\u{200c}\u{200c}\u{200c}\u{200b}\u{200c}\u{200b}\u{200c}\u{200c}\u{200d}\u{200c}\u{200b}\u{200c}\u{200c}\u{200c}\u{200b}\u{200b}\u{200c}\u{200c}\u{200c}\u{200d}\u{200c}\u{200b}\u{200c}\u{200c}\u{200c}\u{200b}\u{200c}\u{200b}\u{200b}\u{200c}\u{200d}\u{200c}\u{200b}\u{200c}\u{200c}\u{200b}\u{200b}\u{200b}\u{200b}\u{200c}\u{200c}\u{200d}\u{200c}\u{200b}\u{200c}\u{200c}\u{200b}\u{200b}\u{200b}\u{200c}\u{200c}\u{200c}\u{200d}\u{200c}\u{200b}\u{200c}\u{200c}\u{200b}\u{200b}\u{200c}\u{200b}\u{200c}\u{200c}\u{200d}\u{200c}\u{200b}\u{200c}\u{200c}\u{200b}\u{200b}\u{200b}\u{200b}\u{200c}\u{200c}\u{200d}\u{200c}\u{200b}\u{200c}\u{200c}\u{200b}\u{200c}\u{200c}\u{200c}\u{200b}\u{200c}\u{200d}\u{200c}\u{200b}\u{200c}\u{200c}\u{200c}\u{200b}\u{200b}\u{200c}\u{200c}\u{200c}";

assert_eq!(zero_width, unicode_representation);

Create HTML representation in zero width characters for "Rustaceans"

use zwnbsp::ZeroWidth;

let zero_width = ZeroWidth::new("Rustaceans").unwrap().to_html();
let unicode_representation = "‌​‌​‌​​‌​‌‍‌​‌‌‌​‌​‌‌‍‌​‌‌‌​​‌‌‌‍‌​‌‌‌​‌​​‌‍‌​‌‌​​​​‌‌‍‌​‌‌​​​‌‌‌‍‌​‌‌​​‌​‌‌‍‌​‌‌​​​​‌‌‍‌​‌‌​‌‌‌​‌‍‌​‌‌‌​​‌‌‌&#8205";

assert_eq!(zero_width, unicode_representation);