On Mon, December 19, 2011 1:35 pm, Дмитрий Франк wrote:
> Citation from help: "Return the *byte count* from the start of the buffer
> for line {lnum}"
>
> Returned *byte count* is wrong. It returns character count instead of byte
> count.
>
> Your suggestion to use strchars() is too expansive - i need just get byte
> count, and i need to allocate a huge string for this (say, i edit 500-Kb
> file), and do split() or substitute(). This isn't good solution.
I can't reproduce this.
Here is what I did. I created a new file, containing:
<snip>
a
Ё
</snip>
e.g. a LATIN SMALL LETTER A (U+0061) followed by a line break followed by
the CYRILLIC CAPITAL LETTER IO (U+0401) followed by a line break and
followed by an empty line. This is a Windows built of Vim 7.3.46 (with
encoding set to utf-8 and fileformat=dos).
On each line I entered:
echo line2byte('.')
and it outputted the correct values, e.g.
1 on the first line,
4 on the second line,
8 on the last line
The files total size is 9 bytes and all this is correct and can be
validated by using xxd.
regards,
Christian
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php