We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff7b824 commit 2eb5038Copy full SHA for 2eb5038
src/lib.rs
@@ -6,7 +6,7 @@
6
7
mod tables;
8
9
-use core::convert::TryFrom;
+use core::convert::{TryFrom, TryInto};
10
use core::fmt;
11
use core::u64;
12
pub use tables::script_extensions;
@@ -38,6 +38,12 @@ impl Script {
38
Self::inner_from_short_name(input)
39
}
40
41
+ /// The 4-byte iso15924 tag as a `u32`
42
+ pub fn as_iso15924_tag(self) -> u32 {
43
+ let arr: [u8; 4] = self.inner_short_name().as_bytes().try_into().unwrap();
44
+ u32::from_be_bytes(arr)
45
+ }
46
+
47
/// Is this script "Recommended" according to
48
/// [UAX #31](www.unicode.org/reports/tr31/#Table_Recommended_Scripts)?
49
pub fn is_recommended(self) -> bool {
0 commit comments