I'm using the following _vimrc.
====== _vimrc ==========
if has("multi_byte")
if &enc !~? '^u'
if &tenc == ""
let &tenc = &enc
endif
set enc=utf-8
endif
set fencs=ucs-bom,utf-8,latin1
lan fr_FR.UTF-8
endif " }}}
==========================
I want call gVim from an external program (LifeLines) with a UTF-8 BOM
temporary file but a can have illegal UFT-8 like :
1 FAMS @F16797@ {{(F16797) 1h,1w,0ch, B de Talleyrand-PÃ m. A. Morel }}
!
é without 2nd byte --+
I get :
enc=uft-8
fenc=latin1 (and not utf-8)
I want to force fenc to uft-8 but the following calling command doesn't
work :
c:\vim\vim71\gvim.exe -c"++enc=utf-8" -f
c:\vim\vim71\gvim.exe -c"set fencs=utf-8" -f
0 @I41085@ INDI
1 NAME Boson /de Talleyrand-Périgord/
--
Patrick Texier
vim:syntax=mail:ai:ts=4:et:tw=72
'fileencodings', no matter what you set it to, will never detect a file
as UTF-8 if it contains invalid UTF-8 sequences.
To force opening as UTF-8, try (after setting 'enc' to utf-8, see
http://vim.sourceforge.net/scripts/script.php?script_id=789 )
:e ++enc=utf-8 foobar.txt
(replacing, of course, foobar.txt by the filename), see ":help ++opt".
WARNING: Any invalid bytes will be replaced by ? (question mark, 0x3F).
Best regards,
Tony.
--
Overheard in a bar:
Man: "Hey, Baby, I'd sure like to get in your pants!"
Woman: "No, thanks, I've already got one ass-hole in there now."
> To force opening as UTF-8, try (after setting 'enc' to utf-8, see
> http://vim.sourceforge.net/scripts/script.php?script_id=789 )
>
> :e ++enc=utf-8 foobar.txt
>
> (replacing, of course, foobar.txt by the filename), see ":help ++opt".
Thanks Tony. I'm using
:e! ++enc=uft-8
> WARNING: Any invalid bytes will be replaced by ? (question mark, 0x3F).
All invalid bytes are in comments between {{ ... }} and not written in
database.
1 FAMS @F16797@ {{(F16797) 1h,1w,0ch, B de Talleyrand-PÃ m. A. Morel }}
I will report (for fix) this LifeLines bug.
--
Patrick Texier,
Frulon, 36190 Orsennes, France (46°31'N, 01°41'E)
<http://www.genindre.org>
<http://www.gpsql.org> <http://www.footsql.org>