Automatically change encoding when opening file

2012-11-15 Thread BPJ
I regularly get files encoded in UTF16LE sent to me and want them to be automatically converted to UTF8 when opening them. I'm not sure what command to use/put in .vimrc for that though, so I wonder if anybody is already doing this, and how? /bpj -- You received this message from the "vim_use"

Re: Automatically change encoding when opening file

2012-11-15 Thread Tony Mechelynck
On 15/11/12 09:18, BPJ wrote: I regularly get files encoded in UTF16LE sent to me and want them to be automatically converted to UTF8 when opening them. I'm not sure what command to use/put in .vimrc for that though, so I wonder if anybody is already doing this, and how? /bpj If a file in UTF

Re: Automatically change encoding when opening file

2012-11-29 Thread Ven Tadipatri
On Thu, Nov 15, 2012 at 8:31 AM, Tony Mechelynck wrote: > > If a file in UTF-16le has a BOM (the codepoint U+FEFF at the very beginning > of the file, which for UTF-16le means the bytes 0xFF 0xFE), then if you have > set Vim to use UTF-8 'encoding' in your vimrc that file will usually be > opened

Re: Automatically change encoding when opening file

2012-11-29 Thread Ben Fritz
On Thursday, November 29, 2012 2:41:16 PM UTC-6, vtadipatri wrote: > > I'm not really that familiar with the different encoding types (UTF-8, > > UTF-16, etc), but when I came across a strange character which > > I think is related to what you're describing. > > I open up two files in gedit

Re: Automatically change encoding when opening file

2012-11-29 Thread Marcin Szamotulski
On 15:41 Thu 29 Nov , Ven Tadipatri wrote: > On Thu, Nov 15, 2012 at 8:31 AM, Tony Mechelynck > wrote: > > > > > If a file in UTF-16le has a BOM (the codepoint U+FEFF at the very beginning > > of the file, which for UTF-16le means the bytes 0xFF 0xFE), then if you have > > set Vim to use UTF-

Re: Automatically change encoding when opening file

2012-11-29 Thread Ben Fritz
On Thursday, November 29, 2012 3:16:33 PM UTC-6, coot_. wrote: > > is the BOM character for UTF-16 encoding. UTF-16 uses 2 bytes to > > encode a character, but the order of them might differ. This BOM > > character tells which byte comes first. > feff is the BOM character for UTF-8 as well,