Why vim doesn't insert cyrillic symbols properly in Ex mode?

31 views
Skip to first unread message

Stas Malavin

unread,
Jun 4, 2014, 1:50:23 PM6/4/14
to vim...@googlegroups.com
To make changes in several files I use the following script:

echo search('publications.html"') | normal o<li><a href="./book_series.html">Книжные серии</a></li>
echo search('collections.html"') | d
echo search('photo.html"') | d
wq

Then I do
for file in *.html do; vim -e $file < script; done

As a result a string "^Z=86=K5 A5@88" is inserted instead of "Книжные серии". All html files as well as the script itself are utf-8 encoded, and no other problems with Cyrillic revealed. What's going on?

Thanks in advance for any comment!

Yukihiro Nakadaira

unread,
Jun 5, 2014, 10:08:14 AM6/5/14
to vim...@googlegroups.com, vim...@googlegroups.com
CC to vim_dev

In Ex mode, multi-byte character is not handled.
Please check the attached patch.

--
Yukihiro Nakadaira - yukihiro....@gmail.com
exmbyte.diff

Bram Moolenaar

unread,
Jun 5, 2014, 1:40:40 PM6/5/14
to Yukihiro Nakadaira, vim...@googlegroups.com, vim...@googlegroups.com

Yukihiro Nakadaira wrote:

> CC to vim_dev
>
> On Thu, Jun 5, 2014 at 2:50 AM, Stas Malavin <stas.m...@gmail.com> wrote> :
>
> > To make changes in several files I use the following script:
> >
> > echo search('publications.html"') | normal o<li><a
> > href="./book_series.html">Книжные > серии</a></li>
> > echo search('collections.html"') | d
> > echo search('photo.html"') | d
> > wq
> >
> > Then I do
> > for file in *.html do; vim -e $file < script; done
> >
> > As a result a string "^Z=86=K5 A5@88" is inserted instead of "К> нижные
> > серии". All html files as well as the script its> elf are utf-8 encoded, and
> > no other problems with Cyrillic revealed. What's going on?
> >
> > Thanks in advance for any comment!
>
> In Ex mode, multi-byte character is not handled.
> Please check the attached patch.

Thanks, I'll check it out.

--
hundred-and-one symptoms of being an internet addict:
268. You get up in the morning and go online before getting your coffee.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Stas Malavin

unread,
Jun 5, 2014, 6:00:48 PM6/5/14
to vim...@googlegroups.com
Thanks to Ben at stackoverflow.com (http://stackoverflow.com/questions/24019364/why-vim-doesnt-insert-cyrillic-symbols-properly-in-ex-mode), the solution is to use
vim -S script $file
instead of
vim -e $file < script
Reply all
Reply to author
Forward
0 new messages