| 1 | module builtin |
| 2 | |
| 3 | pub fn utf8_str_visible_length(s string) int { |
| 4 | // todo: proper implementation |
| 5 | res := 0 |
| 6 | #res.val = s.str.length; |
| 7 | |
| 8 | return res |
| 9 | } |
| 10 | |
| 11 | pub fn utf8_str_len(s string) int { |
| 12 | return s.len |
| 13 | } |
| 14 | |
| 15 | pub fn utf8_char_len(b u8) int { |
| 16 | return ((0xe5000000 >> ((b >> 3) & 0x1e)) & 3) + 1 |
| 17 | } |
| 18 |