vim: how to type extended-ascii?

1302 views
Skip to first unread message

David de Kloet

unread,
Mar 21, 2004, 10:46:08 AM3/21/04
to
Hi,

I have a file which countains characters that appear as ~W in vim (and
as <97> in less) and I want to replace them all by a -. But I don't
know how to type this character into a substitute command.
Any help is appreciated.

thanks,
David

Mikolaj Machowski

unread,
Mar 22, 2004, 5:25:51 AM3/22/04
to
David de Kloet scripsit:

> Hi,
> I have a file which countains characters that appear as ~W in vim (and
> as <97> in less) and I want to replace them all by a -. But I don't
> know how to type this character into a substitute command.

In command line <c-v>97 (or <c-q> on windows).

More in
:h i_CTRL-V_digit

m.
--
LaTeX + Vim = http://vim-latex.sourceforge.net/
Learn Touch Typing with Vim? Oui. Ja. Yes. Tak:
http://vim.sourceforge.net/script.php?script_id=461
vim.pl - http://skawina.eu.org/mikolaj

David de Kloet

unread,
Mar 22, 2004, 7:35:51 AM3/22/04
to
On Mon, 22 Mar 2004, Mikolaj Machowski wrote:

> David de Kloet scripsit:
> > Hi,
> > I have a file which countains characters that appear as ~W in vim (and
> > as <97> in less) and I want to replace them all by a -. But I don't
> > know how to type this character into a substitute command.
>
> In command line <c-v>97 (or <c-q> on windows).

It should be <c-v>x97 because less shows it in hex (and 97 would be an
'a'). But thanks a lot.

Could I have found out this number 97 in vim (without less)?

thanks,
David

Kenny McCormack

unread,
Mar 22, 2004, 8:01:47 AM3/22/04
to

Thomas W Ping

unread,
Mar 28, 2004, 6:52:42 AM3/28/04
to
Mikolaj Machowski wrote:

>:h i_CTRL-V_digit

Hmmm. I grabbed a chart with extended ASCII[1] and randomly entered...

<c-v>xba

...and got the character shown for ba on the *Windows* assignments chart.
I'm running Linux.

Whuh?

[1]http://www.jimprice.com/jim-asc.htm

--
Thomas Winston Ping

Mikolaj Machowski

unread,
Mar 28, 2004, 6:10:05 PM3/28/04
to
Thomas W Ping scripsit:

> Mikolaj Machowski wrote:
>>:h i_CTRL-V_digit
> Hmmm. I grabbed a chart with extended ASCII[1] and randomly entered...
><c-v>xba
> ...and got the character shown for ba on the *Windows* assignments chart.
> I'm running Linux.
> Whuh?

Currently extended ASCII is understood as iso-8859-1, which is equal to
cp1252.

> [1]http://www.jimprice.com/jim-asc.htm

You are probably wondering about IBM PC Extended ASCII? AFAIK this is
known as IBM852 (aka cp852?) and rather dropped.

Giuseppe Bilotta

unread,
Mar 28, 2004, 6:20:41 PM3/28/04
to
Mikolaj Machowski wrote:
> Thomas W Ping scripsit:
> > Mikolaj Machowski wrote:
> >>:h i_CTRL-V_digit
> > Hmmm. I grabbed a chart with extended ASCII[1] and randomly entered...
> ><c-v>xba
> > ...and got the character shown for ba on the *Windows* assignments chart.
> > I'm running Linux.
> > Whuh?
>
> Currently extended ASCII is understood as iso-8859-1, which is equal to
> cp1252.

Not 100%.

> > [1]http://www.jimprice.com/jim-asc.htm
>
> You are probably wondering about IBM PC Extended ASCII? AFAIK this is
> known as IBM852 (aka cp852?) and rather dropped.

More likely CP437?

--
Giuseppe "Oblomov" Bilotta

Can't you see
It all makes perfect sense
Expressed in dollar and cents
Pounds shillings and pence
(Roger Waters)

Mark J. Reed

unread,
Mar 28, 2004, 7:53:47 PM3/28/04
to
There is no such thing as "extended ASCII".

There is ASCII, which defines 128 characters and no more. Then there are
many, many, many different character sets designed such that ASCII is a subset
of them. These may logically be regarded as extensions to ASCII, but you
can't point to any one of them and say "that's Extended ASCII".

In countries that speak a Western European language (which includes English
and therefore the US), the most popular 8-bit character sets are ISO-8859-1
(a.k.a. "Latin-1") and Windows-1252 (which is largely compatible with
Latin-1 but is not the same thing). Other countries use different character
sets.

Fortunately, all of these character sets may be viewed as windows (not
necessarily contiguous windows) onto the Unicode character set, and it usually
makes the most sense to speak of characters in terms of their Unicode code
points. I use VIM exclusively in UTF-8 mode (it converts files as needed
to and from other character sets) and it simplifies things greatly.

-Mark

Mikolaj Machowski

unread,
Apr 1, 2004, 2:30:57 PM4/1/04
to
Giuseppe Bilotta scripsit:

>> > [1]http://www.jimprice.com/jim-asc.htm
>> You are probably wondering about IBM PC Extended ASCII? AFAIK this is
>> known as IBM852 (aka cp852?) and rather dropped.
> More likely CP437?

Probably. I am trying to forget times of 10 competiting ways of encoding
Polish diacritics :)

Reply all
Reply to author
Forward
0 new messages