Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let char = string[offset]
- function s:GetCharAtByteIdx(str, index)
- " AFAIK maximum length of utf8-char is 4 byte
- let sp = a:str[a:index:(a:index+4)]
- let chr = strcharpart(sp, 0, 1)
- return [ chr, (a:index + strlen(chr)) ]
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement