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

Re: UFT-8 and illegal sequences

Expand Messages
  • Tony Mechelynck
    ... 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
    Message 1 of 3 , May 6, 2008
    • 0 Attachment
      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
      -~----------~----~----~----~------~----~------~--~---
    • Patrick Texier
      Le Tue, 06 May 2008 12:55:10 +0200, Tony Mechelynck a écrit dans le ... Thanks Tony. I m using ... All invalid bytes are in comments between {{ ... }} and not
      Message 2 of 3 , May 6, 2008
      • 0 Attachment
        Le Tue, 06 May 2008 12:55:10 +0200, Tony Mechelynck a écrit dans le
        message <4820390E.3000409@...> :

        > 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>

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_multibyte" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.