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

Re: Vim and text in national languages

Expand Messages
  • Tony Mechelynck
    ... Sometimes it makes a difference. Here are a few examples: - on Unix, the #! at the start of a script won t be recognized if there s a BOM before it. - on
    Message 1 of 16 , May 29, 2008
    • 0 Attachment
      On 29/05/08 09:13, Dmitry Teslenko wrote:
      > On Thu, May 29, 2008 at 4:20 AM, Tony Mechelynck
      > <antoine.mechelynck@...> wrote:
      >> 5. If you edit files in Unicode and in cp1251, I recommend
      >> :set fencs=ucs-bom,utf-8,cp1251
      > Some testing on my own and I've come to this too.
      >
      >> 6. I use the following 'statusline' setting to display the
      >> 'fileencoding' and 'bomb' used for the file being edited in each window.
      >> Note that 'bomb' has no effect unless 'fileencoding' is a Unicode encoding:
      >>
      >> if has("statusline")
      >> set statusline=%<%f\ %h%m%r%=%k[%{(&fenc\ ==\
      >> \"\"?&enc:&fenc).(&bomb?\",BOM\":\"\")}]\ %-12.(%l,%c%V%)\ %P
      >> endif
      > Why do you interested in is there bom or not?

      Sometimes it makes a difference. Here are a few examples:
      - on Unix, the #! at the start of a script won't be recognized if
      there's a BOM before it.
      - on Windows (at least on XP), IIRC WordPad can read UTF-8 _provided_
      that there is a BOM. (When _writing_ "Unicode text" what it produces is
      UTF-16le with BOM.)
      - when handlling files which I haven't created myself, it may sometimes
      be interesting to see at a glance whether or not there is a BOM.

      Best regards,
      Tony.
      --
      Wood is highly ecological, since trees are a renewable resource. If
      you cut down a tree, another will grow in its place. And if you cut
      down the new tree, still another will grow. And if you cut down that
      tree, yet another will grow, only this one will be a mutation with
      long, poisonous tentacles and revenge in its heart, and it will sit
      there in the forest, cackling and making elaborate plans for when you
      come back.

      Wood heat is not new. It dates back to a day millions of years ago,
      when a group of cavemen were sitting around, watching dinosaurs rot.
      Suddenly, lightning struck a nearby log and set it on fire. One of the
      cavemen stared at the fire for a few minutes, then said: "Hey! Wood
      heat!" The other cavemen, who did not understand English, immediately
      beat him to death with stones. But the key discovery had been made,
      and from that day forward, the cavemen had all the heat they needed,
      although their insurance rates went way up.
      -- Dave Barry, "Postpetroleum Guzzler"

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