From owner-freebsd-questions@FreeBSD.ORG Tue Sep 9 05:26:39 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EE0C1065670 for ; Tue, 9 Sep 2008 05:26:39 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id E06168FC1A for ; Tue, 9 Sep 2008 05:26:38 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl21-99.kln.forthnet.gr [77.49.148.99]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id m895QSLK003750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 9 Sep 2008 08:26:34 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id m895QRmJ027845; Tue, 9 Sep 2008 08:26:27 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id m895QQOS027844; Tue, 9 Sep 2008 08:26:26 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Gary Kline References: <20080909043503.GA21663@thought.org> Date: Tue, 09 Sep 2008 08:26:25 +0300 In-Reply-To: <20080909043503.GA21663@thought.org> (Gary Kline's message of "Mon, 8 Sep 2008 21:35:07 -0700") Message-ID: <8763p5yjni.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: m895QSLK003750 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.845, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.55, BAYES_00 -2.60, FB_WORD1_END_DOLLAR 0.00) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: FreeBSD Mailing List Subject: Re: how can i use ISO-8859-1?? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2008 05:26:39 -0000 On Mon, 8 Sep 2008 21:35:07 -0700, Gary Kline wrote: > Guys, > > This is one of the I've-been-meaning-to-ask questions; but other > things keep happening that took precedence. Now it's time to ask what > are the voodoo commands to set up in my ~/.zshrc or other initiation > files (probably including my muttrc) that will let me print to stdout, > characters like the "e-aigu" or "u-umlaut" and the currency pound or > Euro? > > I keep running into '\240' characters that are likely M$ format > commands. [...] That's not really an ISO 8859-1 problem, but a locale setup issue. In my .bashrc file I have the following: # Locale setup. export LANG="C" export LC_CTYPE="el_GR.ISO8859-7" export LC_COLLATE="el_GR.ISO8859-7" unset LC_ALL LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME You can use something similar to set things up for `en_US.ISO8859-1': # Locale setup. export LANG="C" export LC_CTYPE="en_US.ISO8859-1" export LC_COLLATE="en_US.ISO8859-1" unset LC_ALL LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME If you want _everything_ to be displayed using the standard en_US conventions for en_US.ISO8859-1, you can alternatively use: export LANG="C" export LC_ALL="en_US.ISO8859-1" unset LC_CTYPE LC_COLLATE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME and let LC_ALL override everything. A slightly better idea (which doesn't hardcode LANG and LC_ALL for all shell instances) is to configure your personal `.login_conf' file with something like: me:\ :charset=iso-8859-1:\ :lang=en_US.ISO8859-1:\ :setenv=LC_ALL=en_US.ISO8859-1: With this in place you will get the 'correct' environment regardless of the login shell you are using: bash, csh or zsh. Note: By avoiding hardcoded locale setup in your shell startup file you can even spawn sub-shells with different locales. Here's how a zsh session with `en_US.ISO8859-1' can spawn a ksh session with a Greek locale for example: zsh> env | egrep '^(LANG|LC_ALL)' LANG=en_US.ISO8859-1 LC_ALL=en_US.ISO8859-1 zsh> env LANG='el_GR.ISO8859-7' LC_ALL='el_GR.ISO8859-7' ksh ksh$ mutt Note that this is only ``half of the setup'' though. You will then have to make sure that your terminal emulator can display ISO 8859-1 text correctly, by choosing an appropriate font set. The xlsfonts(1) and the fc-list(1) utilities can show you a list of installed fonts: # xlsfonts | fgrep '8859-1' # fc-list Pick one that includes ISO 8859-1 characters, and off you go :)