Consider the following line:   This file is encoded in UTF-8 and between the two Euro marks is a Tab character (the Stack Exchange software expands this to spaces). The byte value is:e2 82 ac 09 e2 82 ac 0aIn my script I would like to get the character under the cursor.Vim has several useful functions for dealing with strings in a multibyte-aware fashion, but getting the cursor position seems difficult:col('.') will return the byte position. So for the tab it will return 4 rather than 2.virtcol('.') almost works, but will expand tabs, so this isn't a true character position either.All other functions behave as one of the two above.What I have so far is:fun! Getchar()    let l:line = substitute(getline('.'), '\t', repeat(' ', &tabstop), 'g')    return strcharpart(l:line, virtcol('.') - 1, 1)endfunnnoremap GG :echo Getchar()<CR>Which almost works, but not for the above example since the displayed width is less than &tabstop spaces long.
How can I get the character at the cursor position in a multibyte aware manner?
vimscript;unicode;cursor
We discussed it less then 10 days ago on reddit.One solution is matchstr(getline('.'), '\%'.col('.').'c.') which doesn't mess with any register.I've put the resulting functions (we can ask for the characters before, or after the cursor) in my vimscript library along with other functions on the subject.