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.
2 parents 323e8df + 87af9af commit 1ad9b49Copy full SHA for 1ad9b49
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 big-endian `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