[−][src]Crate zwnbsp
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 = "‌​‌​‌​​‌​‌‍‌​‌‌‌​‌​‌‌‍‌​‌‌‌​​‌‌‌‍‌​‌‌‌​‌​​‌‍‌​‌‌​​​​‌‌‍‌​‌‌​​​‌‌‌‍‌​‌‌​​‌​‌‌‍‌​‌‌​​​​‌‌‍‌​‌‌​‌‌‌​‌‍‌​‌‌‌​​‌‌‌‍"; assert_eq!(zero_width, unicode_representation);
Structs
Binary | Binary Representation of a |
ZeroWidth |
Enums
Error |
Constants
WORD_JOINER | Word joiner (WJ) |
ZERO_WIDTH_JOINER | Zero-width joiner (ZWJ) |
ZERO_WIDTH_NON_JOINER | Zero-width non-joiner (ZWNJ) |
ZERO_WIDTH_NO_BREAK_SPACE | Zero-width No-Break Space (ZWNBSP) |
ZERO_WIDTH_SPACE | Zero-width space (ZWSP) |