ANSI<>UNICODE and reverse

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

ANSI<>UNICODE and reverse

Paolo Baruffa (wintec)

Hi all!
I need to perform ANSI/UNICODE commands in my GVIM.
I read many docs on the web about and I did set these:

"------------------------------------------
" .vimrc  includes
"----------------------
:set ffs=dos,unix,mac " autosense Dos,Unix,Mac
:set fileencodings=ucs-bom,utf-8,latin1 " autosense coding
" (no fileencoding is set in .vimrc)

"------------------------------------------
" my menu includes
"----------------------

:set fileencoding=latin1<CR><Esc>:set ff=dos<CR>:w!<CR> " ANSI Dos
:set fileencoding=utf-8<CR>:w!<CR><Esc> " UNICODE

"-------------------------------------------

but they don't work correctly (I check the files with an
other editor)...

1) I open an ANSI file with GVim, I ask ":set fileencoding"
and the file appears as "utf-8"

2) conversion between ANSI <> UNICODE and then reverse likes
right ("converted" in bottom status line), but refreshing
the file on the other editor I see the same coding...

Does anybody can help, pls?


--~--~---------~--~----~------------~-------~--~----~
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: ANSI<>UNICODE and reverse

winterTTr-2
On Thu, Nov 5, 2009 at 7:56 PM, Paolo Baruffa <[hidden email]> wrote:

Hi all!
I need to perform ANSI/UNICODE commands in my GVIM.
I read many docs on the web about and I did set these:

"------------------------------------------
"       .vimrc  includes
"----------------------
:set ffs=dos,unix,mac   "       autosense Dos,Unix,Mac
:set fileencodings=ucs-bom,utf-8,latin1 "       autosense coding
" (no fileencoding is set in .vimrc)

"------------------------------------------
"       my menu includes
"----------------------

:set fileencoding=latin1<CR><Esc>:set ff=dos<CR>:w!<CR> " ANSI Dos
:set fileencoding=utf-8<CR>:w!<CR><Esc> " UNICODE

"-------------------------------------------

but they don't work correctly (I check the files with an
other editor)...

1) I open an ANSI file with GVim, I ask ":set fileencoding"
and the file appears as "utf-8"

What's the value for the option "encoding" ?
if the "encoding" is set to utf-8 when you don't set "fenc" , the file 
will open with the same encoding as what you set to enc , which should 
become 'utf8'
 

2) conversion between ANSI <> UNICODE and then reverse likes
right ("converted" in bottom status line), but refreshing
the file on the other editor I see the same coding...

What do you mean for the "The same coding "?
The coding is always ANSI or UNICODE?

And before this , there is something should be mentioned.
UTF-8 is a variable-length character encoding for UNICODE , and 
if you original file is ansi encoding ,  when it is convert to utf8 ( without BOM),
the file should be same ( seems like no convert ). Because utf8 uses the single
octet encoding only for the 128 US-ASCII characters  which is the same as
when it is encoding with ansi.
 

Does anybody can help, pls?





--~--~---------~--~----~------------~-------~--~----~
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: ANSI<>UNICODE and reverse

JohnBeckett
In reply to this post by Paolo Baruffa (wintec)

Paolo wrote:
> I need to perform ANSI/UNICODE commands in my GVIM.

See discussion in vim_use
http://groups.google.com/group/vim_use/browse_thread/thread/cc7e9076fa7d277d

John


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