multibyte charaters can not be displayed in silent ex mode

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

multibyte charaters can not be displayed in silent ex mode

sola-4


I tried the following command with some Chinese characters in file
kk.txt.

vim --noplugin  -es  kk.txt +"set encoding=utf-8" +"set tenc=cp950"
+"set fileencoding=ucs-2le" +print  +q!

It does not  work,only gibberish characters are displayed.

Without using silent mode , the characters are displayed correctly.

vim --noplugin  -e kk.txt +"set encoding=utf-8" +"set tenc=cp950"
+"set fileencoding=ucs-2le" +print

I  am using vim7 on windows.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: multibyte charaters can not be displayed in silent ex mode

Bram Moolenaar


Sola wrote:

> I tried the following command with some Chinese characters in file
> kk.txt.
>
> vim --noplugin  -es  kk.txt +"set encoding=utf-8" +"set tenc=cp950"
> +"set fileencoding=ucs-2le" +print  +q!
>
> It does not  work,only gibberish characters are displayed.
>
> Without using silent mode , the characters are displayed correctly.
>
> vim --noplugin  -e kk.txt +"set encoding=utf-8" +"set tenc=cp950"
> +"set fileencoding=ucs-2le" +print
>
> I  am using vim7 on windows.

Check the help for the -s option:  :help -s-ex

Perhaps it's something in your vimrc that matters.  Try using "-u NONE"
to both commands.

Setting 'fileencoding' before loading a file has no effect.  Try setting
'fileencodings'.

--
Drink wet cement and get really stoned.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: multibyte charaters can not be displayed in silent ex mode

sola-4

> Perhaps it's something in your vimrc that matters.  Try using "-u NONE"
> to both commands.
>
> Setting 'fileencoding' before loading a file has no effect.  Try setting
> 'fileencodings'.


I tried with different termencoding,it has no effect on the output at
all.
I tried with different encoding,it only works when encoding is same as
the codepage in using or ucs-2le

vim --noplugin  -es   -u NONE +"set enc=cp950" +"set tenc=cp950" +"set
fencs=ucs-2le"  kk.txt +print  +q!
vim --noplugin  -es   -u NONE +"set enc=ucs2-le" +"set tenc=cp950"
+"set fencs=ucs-2le"  kk.txt +print  +q!
These works,

vim --noplugin  -es   -u NONE +"set enc=utf-8" +"set tenc=cp950" +"set
fencs=ucs-2le" +kk.txt +print  +q!
but not this.


That means termencoding has no effect in silent ex mode?
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: multibyte charaters can not be displayed in silent ex mode

sola-4

> vim --noplugin  -es   -u NONE +"set enc=ucs2-le" +"set tenc=cp950" kk.txt +print  +q!


typo error:
It should be "ucs-2le" but not "ucs2-le"
so this dont work too.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---