первый коммит
This commit is contained in:
commit
81034325a1
13 files changed
+810
No files matched your search
@@ -0,0 +1,10 @@
|
||||
module utils
|
||||
|
||||
pub fn is_utf8(bytes []u8) bool {
|
||||
first_byte_amount := bytes.str().count(bytes[0].str())
|
||||
percent := f32(first_byte_amount) / f32(bytes.len)
|
||||
|
||||
result := if percent >= 0.1 { true } else { false }
|
||||
|
||||
return result
|
||||
}
|
||||
Reference in new issue
Block a user