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

36767Re: Extended ASCII characters garbled in Vim 6.3b [Win32 console]

Expand Messages
  • Bram Moolenaar
    Jun 2, 2004
    • 0 Attachment
      Craig Barkhouse wrote:

      > OK, by "ASCII art" I think I do mean what you call "DOS characters" --
      > extended ASCII characters in the 128-255 range. These include special
      > graphic symbols as well as certain accented characters. For example, 251 is
      > a square root symbol (?). If you're at a Windows cmd prompt you should be
      > able to press Alt+251 (numeric keypad) to make the symbol appear. You can
      > echo the character to a file to do a little test. Edit the file with VIM,
      > and with tenc=cp437 the character appears as a u-circumflex. With tenc= or
      > tenc=cp1252, it appears as a square root symbol.

      Yes, but that's only because no conversion is done. To do it correctly
      you would actually have to set 'encoding' to cp437 and leave
      'termencoding' at the default.

      > In GVIM, no matter what tenc is set to, the character appears as a
      > square root symbol.

      For me it appears as u-circumflex. Do you have cp437 as the default
      encoding for your system? Not a good idea. Or do you have
      'fileencodings' include cp437? Then it would still not work when
      'encoding' is latin1. Thus I don't understand why you see the character
      you want to see...

      > Now, I have some extended ASCII (128-255) symbols in my .vimrc, and I just
      > want them to display properly (as symbols, not accented characters as in
      > Latin-1) on screen.
      >
      > Curiously, when I set my codepage to 1252 and start VIM, tenc is not
      > "cp1252" but rather is empty. cp1252 looks like it has all the special
      > symbols I'm looking for.

      cp1252 does _not_ contain those symbols. Vim is simply omitting the
      conversion, which happens to work for these characters. The symbols are
      in cp437.

      You could use cp437 as your normal encoding, but be warned that most
      files these days are latin1 (or cp1252) and then those won't show up
      correctly. Using "utf-8" for 'encoding' and making sure the files are
      read with the real encoding would be the only way to use both.

      --
      Apparently, 1 in 5 people in the world are Chinese. And there are 5
      people in my family, so it must be one of them. It's either my mum
      or my dad. Or my older brother Colin. Or my younger brother
      Ho-Cha-Chu. But I think it's Colin.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
    • Show all 13 messages in this topic