1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/builtin/js/utf8.js.v

18 lines
287 B
V
Raw Normal View History

module builtin
pub fn utf8_str_visible_length(s string) int {
// todo: proper implementation
res := 0
#res.val = s.str.length;
return res
}
pub fn utf8_str_len(s string) int {
return s.len
}
2022-04-15 20:31:10 +03:00
pub fn utf8_char_len(b u8) int {
return ((0xe5000000 >> ((b >> 3) & 0x1e)) & 3) + 1
}