Loading ...
Sorry, an error occurred while loading the content.

2482Re: UFT-8 and illegal sequences

Expand Messages
  • Tony Mechelynck
    May 6 3:55 AM
      On 06/05/08 12:27, Patrick Texier wrote:
      > I'm Using gVim 7.1.293 (huge with multibyte_ime/dyn, iconv/dyn...) on
      > Windows.
      >
      > 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/

      '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."

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_multibyte" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Show all 3 messages in this topic