*BSD News Article 55156


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!bukula.enternet.com.au!yarrina.connect.com.au!munnari.OZ.AU!spool.mu.edu!agate!dog.ee.lbl.gov!overload.lbl.gov!lll-winken.llnl.gov!uwm.edu!homer.alpha.net!mvb.saic.com!news.mathworks.com!newsfeed.internetmci.com!in1.uu.net!EU.net!Germany.EU.net!Dortmund.Germany.EU.net!nntp.gmd.de!news.ruhr-uni-bochum.de!news.rhrz.uni-bonn.de!mpifr-bonn.mpg.de!comma.rhein.de!serpens!not-for-mail
From: mlelstv@serpens.rhein.de (Michael van Elst)
Newsgroups: comp.unix.bsd.netbsd.misc
Subject: Re: vi and chars > 0x7f ?
Date: 22 Nov 1995 10:32:02 +0100
Organization: dis-
Lines: 26
Message-ID: <48uqmi$j4i@serpens.rhein.de>
References: <48qg6i$cr8@murmel.camelot.de>
NNTP-Posting-Host: serpens.rhein.de

thomas@murmel.camelot.de (Thomas Gerner) writes:

>How can I tell vi to print the char and not the hexcode? I found nothing
>in the manual of vi.

vi uses the ctype functions to determine wether a character is
printable. The ctype functions use the current locale to determine
character sets. The C library currently (? at least for 1.0) just
knows about the default "C" locale which corresponds to ASCII.
Any non-ASCII character is not printable and vi will show it in hex
(or octal if you insist).

As soon as the C library implements different locales (like a
ISO Latin 1 locale) this is fixed. To tell the C library and vi
about the locale you can set several environment variables. For
the correct treatment of ISO Latin 1 character classes you would
do a:

setenv LC_CTYPE iso_8859_1

Regards,
-- 
                                Michael van Elst

Internet: mlelstv@serpens.rhein.de
                                "A potential Snark may lurk in every tree."