#unicode #locale #langid


API for managing Unicode Language Identifiers

2 unstable releases

✓ Uses Rust 2018 edition

0.2.0 Jul 9, 2019
0.1.0 Jun 16, 2019

#60 in Internationalization (i18n)

18 downloads per month
Used in 2 crates (1 directly)


274 lines

unic-langid Build Status Coverage Status

unic-langid is an API for managing Unicode Language Identifiers.

The crate provides a way to create a struct from a string, manipulate its fields, canonicalize it, and serialize into a string.


use unic_langid::LanguageIdentifier;

let loc = LanguageIdentifier::from_str("en-US");

assert_eq!(loc.get_language(), "en");
assert_eq!(loc.get_script(), None);
assert_eq!(loc.get_region(), Some("US"));


assert_eq!(&loc.to_string(), "en-Latn-US");


The crate is providing fundamental blocks, but is very basic.

Get Involved

unic-langid is open-source, licensed under the Apache License, Version 2.0. We encourage everyone to take a look at our code and we'll listen to your feedback.

No runtime deps