thooton / transliterate1234

Rust UTF-8 to ASCII transliteration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

transliterate1234

Converts UTF-8 &str to ASCII String. I stole the data file from the popular npm module transliteration and wrote 15 lines.

use transliterate1234::transliterate;

assert_eq!(transliterate("你好,世界"), "NiHao,ShiJie");
assert_eq!(transliterate("Γεια σας, τον κόσμο"), "Geia sas, ton kosmo");
assert_eq!(transliterate("안녕하세요, 세계"), "annyeonghaseyo, segye");
assert_eq!(transliterate("你好, world!"), "NiHao, world!");

About

Rust UTF-8 to ASCII transliteration

License:MIT License


Languages

Language:Rust 100.0%