Re: latin1 vs utf8

2007-01-18 Thread DervishD
Hi Yongwei :) * Yongwei Wu [EMAIL PROTECTED] dixit: On 1/18/07, DervishD [EMAIL PROTECTED] wrote: Did you set 'fileencodings' to an empty string? Otherwise this would not work. Apart from fixing the above (including the last version I posted here, which has a catch, yes, I have

Re: latin1 vs utf8

2007-01-18 Thread Yongwei Wu
On 1/18/07, DervishD [EMAIL PROTECTED] wrote: * Yongwei Wu [EMAIL PROTECTED] dixit: On 1/18/07, DervishD [EMAIL PROTECTED] wrote: Did you set 'fileencodings' to an empty string? Otherwise this would not work. Apart from fixing the above (including the last version I posted here,

Re: latin1 vs utf8

2007-01-18 Thread DervishD
Hi Yongwei :) * Yongwei Wu [EMAIL PROTECTED] dixit: * Yongwei Wu [EMAIL PROTECTED] dixit: On 1/18/07, DervishD [EMAIL PROTECTED] wrote: Did you set 'fileencodings' to an empty string? Otherwise this would not work. Apart from fixing the above (including the last version I

Re: latin1 vs utf8

2007-01-18 Thread A.J.Mechelynck
DervishD wrote: Hi Tony :) * A.J.Mechelynck [EMAIL PROTECTED] dixit: [...] One thing I just noticed: shell scripts (which are text) get application/x-shellscript and no charset, at least on my system; IMHO that's a bug in the file program. I don't know if it is a bug or not, but

Re: latin1 vs utf8

2007-01-17 Thread DervishD
Hi Bram :) * Bram Moolenaar [EMAIL PROTECTED] dixit: utf-8 is a superset of latin1, thus using utf-8 for 'encoding' should nearly always work. Except that then I have to encode my 'showbreak' option as utf8 and not latin1 :( I prefer to have it encoded as latin1 (as the rest

Re: latin1 vs utf8

2007-01-17 Thread A.J.Mechelynck
DervishD wrote: Hi Bram :) * Bram Moolenaar [EMAIL PROTECTED] dixit: utf-8 is a superset of latin1, thus using utf-8 for 'encoding' should nearly always work. Except that then I have to encode my 'showbreak' option as utf8 and not latin1 :( I prefer to have it encoded as latin1 (as

Re: latin1 vs utf8

2007-01-17 Thread DervishD
Hi Tony :) * A.J.Mechelynck [EMAIL PROTECTED] dixit: DervishD wrote: If I change 'enc', I see 'รก', correctly. You should do :edit ++enc=utf-8 filename or include utf-8 in 'fileencodings' before editing the file. Then it will work no matter what 'encoding' is set to. But then my

Re: latin1 vs utf8

2007-01-17 Thread A.J.Mechelynck
DervishD wrote: [...] So, and if I understand everything correctly, if my locale is latin1, my terminal is latin1 (that is, enc=latin1 and tenc=latin1) and I want to edit/view utf8 files *and* I don't want new files or US-ASCII files to be considered utf8, my best bet is to use BufReadPre to

Re: latin1 vs utf8

2007-01-17 Thread DervishD
Hi all, and sorry for self-replying... * DervishD [EMAIL PROTECTED] dixit: I want to edit/view utf8 files *and* I don't want new files or US-ASCII files to be considered utf8, my best bet is to use BufReadPre to detect utf8 files using file -i or something similar, thus forcing the

Re: latin1 vs utf8

2007-01-17 Thread A.J.Mechelynck
DervishD wrote: [...] \ if system(file -i . expand(amatch)) =~ utf8 | [...] On my system, file -i ~/pub/index.htm (for a file in UTF-8) answers /root/pub/index.htm: text/x-c; charset=utf-8 Notice the dash between utf and 8. Best regards, Tony.

Re: latin1 vs utf8

2007-01-17 Thread A.J.Mechelynck
DervishD wrote: Hi Tony :) * A.J.Mechelynck [EMAIL PROTECTED] dixit: DervishD wrote: [...] \ if system(file -i . expand(amatch)) =~ utf8 | [...] On my system, file -i ~/pub/index.htm (for a file in UTF-8) answers /root/pub/index.htm: text/x-c; charset=utf-8 Notice the dash

Re: latin1 vs utf8

2007-01-17 Thread DervishD
Hi Tony :) * A.J.Mechelynck [EMAIL PROTECTED] dixit: Notice the dash between utf and 8. My bad, I typed carelessly. It succeeded on my system because I did my first test with a file *named* 'utf8'. I've noticed the problem a moment ago, and it's already fixed. Hoho... Then maybe

Re: latin1 vs utf8

2007-01-17 Thread A.J.Mechelynck
DervishD wrote: Hi Tony :) * A.J.Mechelynck [EMAIL PROTECTED] dixit: Notice the dash between utf and 8. My bad, I typed carelessly. It succeeded on my system because I did my first test with a file *named* 'utf8'. I've noticed the problem a moment ago, and it's already fixed. Hoho...

Re: latin1 vs utf8

2007-01-17 Thread DervishD
Hi Tony :) * A.J.Mechelynck [EMAIL PROTECTED] dixit: DervishD wrote: * A.J.Mechelynck [EMAIL PROTECTED] dixit: Notice the dash between utf and 8. My bad, I typed carelessly. It succeeded on my system because I did my first test with a file *named* 'utf8'. I've noticed the problem a

Re: latin1 vs utf8

2007-01-17 Thread Bram Moolenaar
DervishD wrote: Hi all, and sorry for self-replying... * DervishD [EMAIL PROTECTED] dixit: I want to edit/view utf8 files *and* I don't want new files or US-ASCII files to be considered utf8, my best bet is to use BufReadPre to detect utf8 files using file -i or something

Re: latin1 vs utf8

2007-01-17 Thread DervishD
Hi Bram :) * Bram Moolenaar [EMAIL PROTECTED] dixit: DervishD wrote: I've done the following autocommand to perform the detection: autocmd BufReadPre * \ if system(file -i . expand(amatch)) =~ utf8 | \ setlocal fenc=utf8 | \ endif I'm sure that it

Re: latin1 vs utf8

2007-01-17 Thread Yongwei Wu
On 1/18/07, DervishD [EMAIL PROTECTED] wrote: Hi Bram :) * Bram Moolenaar [EMAIL PROTECTED] dixit: DervishD wrote: I've done the following autocommand to perform the detection: autocmd BufReadPre * \ if system(file -i . expand(amatch)) =~ utf8 | \ setlocal

Re: latin1 vs utf8

2007-01-16 Thread DervishD
Hi Bram :) * Bram Moolenaar [EMAIL PROTECTED] dixit: DervishD wrote: After that, I've set up this mappings to switch manually from one encoding to other: noremap silent Leader+ :setlocal fenc=utf8 enc=utf8CR noremap silent Leader- :setlocal fenc=latin1 enc=latin1CR

Re: latin1 vs utf8

2007-01-16 Thread DervishD
Hi Bram :) * Bram Moolenaar [EMAIL PROTECTED] dixit: DervishD wrote: Keep in mind that when you change 'encoding' in a running Vim then all text in loaded buffers, registers, variables, etc. will become invalid. It's better to only set 'encoding' when starting up and then leave

Re: latin1 vs utf8

2007-01-16 Thread Bram Moolenaar
Klaus Ethgen wrote: I answer you this way as I am not subscribed to the list and everytime subscribing before sending a mail and unsubscribing afterwards is a bit painful. It's very useful for these message to go to the mailing list. Just subscribe to the mailing list until the thread ends.

Re: latin1 vs utf8

2007-01-16 Thread Bram Moolenaar
DervishD wrote: Did you try setting 'termencoding'? My terminal is latin1 and only understands latin1, unfortunately, so changing termencoding to any different of latin1 just causes more harm. BTW, I use vim always on the virtual console, text mode. If your terminal always is in

latin1 vs utf8

2007-01-15 Thread Klaus Ethgen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I think that question was asked many time before but with differed direction but maybe there is someone having a answer. (I found some for the other direction not for mine.) I have a latin1 setup and like to be able to read utf8 as well. So

Re: latin1 vs utf8

2007-01-15 Thread DervishD
Hi Klaus :) * Klaus Ethgen [EMAIL PROTECTED] dixit: I think that question was asked many time before but with differed direction but maybe there is someone having a answer. (I found some for the other direction not for mine.) I asked more or less the same a few days ago, you can see