11 lines
228 B
V
11 lines
228 B
V
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
|
|
}
|