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

Re: Fileencoding question

Expand Messages
  • Ben Schmidt
    ... This behaviour is correct. ++enc sets encoding for a specific read, fencs sets the encodings to try when reading without ++enc explicitly specified. But
    Message 1 of 4 , May 26 5:02 AM
    • 0 Attachment
      bash wrote:
      > If I use "++enc" it works
      > If i set "koi8-r" to fileencodings it works
      > If i try to change fenc on already opened file - it does not works...

      This behaviour is correct. ++enc sets encoding for a specific read, fencs sets the
      encodings to try when reading without ++enc explicitly specified. But changing
      'fenc' doesn't re-read or re-interpret the file, it sets the encoding that will be
      used the next time the file is saved (so, to convert a file from koi8-r to utf-8,
      for instance, you would do :e ++enc=koi8-r, :set fenc=utf-8, :w, and it would
      continue to apply for future :w commands, too; if you just wanted to write a copy
      in a different encoding, you would just do :w ++enc=utf-8 some-other-file).

      To re-read a file, re-interpreting it with a different encoding, you can just do

      :e ++enc=koi8-r

      You may have already realised that, but perhaps not that you can do it without a
      file name, which you can; if you open something with the wrong encoding and
      quickly want to reload it using the correct one, that's a good way.

      Ben.





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