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

Re: opening a Unicode file

Expand Messages
  • Camillo Särs
    ... Beware, though, that if your environment defaults to utf-8 file encoding, then setting bomb will cause the BOM to be written to all new files. This can
    Message 1 of 6 , Sep 15, 2007
    • 0 Attachment
      Tony Mechelynck wrote:
      > ...and if you want to make sure that "newly created" Unicode files will (or
      > won't) have a BOM by default you can write
      >
      > setglobal bomb
      > or
      > setglobal nobomb
      >
      > in your vimrc. (I use ":setglobal bomb" but YMMV.) This setting has no
      > influence on non-Unicode files such as those in Latin1.

      Beware, though, that if your environment defaults to utf-8 file
      encoding, then setting "bomb" will cause the BOM to be written to all
      new files. This can become a problem when dealing with some legacy
      applications that don't expect to see those extra bytes at the
      beginning. Examples range from *nix shells and hashbang (#!) processing
      to Windows .ini file headings [...].

      So this setting may indeed cause some legacy apps to "bomb" on you.
      Pardon the pun, but I thought it was hilarious once I got over the "duh"
      factor after debugging.

      Regards,
      Camillo
      --
      Camillo Särs <ged@...> Aim for the impossible and you
      http://www.ged.fi will achieve the improbable

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