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

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

Expand Messages
  • Craig Barkhouse
    Jun 2, 2004
      ----- Original Message -----
      From: "Bram Moolenaar" <Bram@...>
      To: "Craig Barkhouse" <cabarkho@...>
      Cc: "VIM Developers" <vim-dev@...>
      Sent: Wednesday, June 02, 2004 3:14 PM
      Subject: Re: Extended ASCII characters garbled in Vim 6.3b [Win32 console]

      > Craig -
      > > Thanks for the reply. On your advice, I looked at what codepage I was
      > > using, and it was something unexpected -- 936. This must have been left
      > > over from the previous person to use this computer (I thought I had
      > > all the crap he did to this computer, but I didn't think to check this).
      > > After some fiddling I managed to change my default codepage back to 437.
      > >
      > > This fixed the problem with characters being displayed as two characters
      > > screen. However, it still didn't produce the results I expected. I
      > > expected to be able to see "ASCII art" like I used to. Instead, I see
      > > accented letters. But in GVIM, it does show the "ASCII art". These are
      > > default options that VIM and GVIM start up with:
      > >
      > > VIM: enc=latin1 fenc= tenc=cp437
      > > GVIM: enc=latin1 fenc= tenc=
      > >
      > > So, there is a difference between the two. Now, if I clear tenc in VIM,
      > > do see my "ASCII art" once more. :) I can work around this by using
      > > tenc=" in my .vimrc. But should VIM and GVIM really display different
      > > characters on screen by default? GVIM seems to ignore tenc completely,
      > > I'm not sure I understand what you mean about having the same option
      > > work in both the GUI and console.
      > I don't know what you mean with "ASCII art". Often these are
      > DOS characters that do not exist in latin1. But then it would not work
      > in gvim either, since you mention it uses latin1.
      > If you have a file with cp437 then you need to make sure that 'encoding'
      > includes these characters. Either set it to "cp437" or "utf-8".
      > Unicode is better, of course, since it includes all possible characters.
      > - Bram

      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. In GVIM, no matter what
      tenc is set to, the character appears as a square root symbol.

      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.
    • Show all 13 messages in this topic