Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add method to return ISO15924 tag asu32#24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Manishearth merged 2 commits intounicode-rs:masterfromnicoburns:iso15924-tag
Aug 15, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletionsrc/lib.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@

mod tables;

use core::convert::TryFrom;
use core::convert::{TryFrom, TryInto};
use core::fmt;
use core::u64;
pub use tables::script_extensions;
Expand DownExpand Up@@ -38,6 +38,12 @@ impl Script {
Self::inner_from_short_name(input)
}

/// The 4-byte iso15924 tag as a big-endian `u32`
pub fn as_iso15924_tag(self) -> u32 {
let arr: [u8; 4] = self.inner_short_name().as_bytes().try_into().unwrap();
u32::from_be_bytes(arr)
}

/// Is this script "Recommended" according to
/// [UAX #31](www.unicode.org/reports/tr31/#Table_Recommended_Scripts)?
pub fn is_recommended(self) -> bool {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp