bidi

Crates.iobidi
lib.rsbidi
version0.1.1
sourcesrc
created_at2023-09-15 13:01:13.733487
updated_at2023-09-16 08:19:39.60105
descriptionImplementation of the Unicode Bidirectional Algorithm (UBA).
homepage
repositoryhttps://github.com/xclud/rust-bidi
max_upload_size
id973656
size2,093,906
Mahdi K. Fard (xclud)

documentation

README

Implementation of the Unicode Bidirectional Algorithm (UBA).

Reference: http://www.unicode.org/reports/tr9/.

Converts logical strings to their equivalent visual representation. Persian, Hebrew and Arabic languages (and any other RTL language) are supported.

use bidi:*;

let text: &str = "مهدی";
let mut text_u16 = text.encode_utf16().collect::<Vec<u16>>();

perform_shaping(&mut text_u16);

let result = String::from_utf16(text_u16.as_slice()).unwrap();
assert_eq!(result, "ﻣﻬﺪﯼ");
Commit count: 18

cargo fmt