From owner-freebsd-questions@FreeBSD.ORG Fri Feb 9 21:16:04 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A82016A400 for ; Fri, 9 Feb 2007 21:16:04 +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 A378213C4B6 for ; Fri, 9 Feb 2007 21:16:03 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (host5.bedc.ondsl.gr [62.103.39.229]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-3) with ESMTP id l19LFIje024102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 9 Feb 2007 23:15:25 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.13.8/8.13.8) with ESMTP id l19LF075006149; Fri, 9 Feb 2007 23:15:12 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.13.8/8.13.8/Submit) id l19LF0bI006148; Fri, 9 Feb 2007 23:15:00 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 9 Feb 2007 23:15:00 +0200 From: Giorgos Keramidas To: Peter Message-ID: <20070209211500.GA6016@kobe.laptop> References: <200702061729.09543.pmatulis@sympatico.ca> <200702090053.52505.pmatulis@sympatico.ca> <20070209152625.GA3512@kobe.laptop> <200702091142.18723.pmatulis@sympatico.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200702091142.18723.pmatulis@sympatico.ca> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.489, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.71, BAYES_00 -2.60, DNS_FROM_RFC_ABUSE 0.20) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org, apatewna@yahoo.gr Subject: Re: toggle between english and french (how?) 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: Fri, 09 Feb 2007 21:16:04 -0000 On 2007-02-09 11:42, Peter wrote: >Le Vendredi 9 F??vrier 2007 10:26, Giorgos Keramidas a ??crit : >> Not really. I'm just trying to understand why you have to change the >> *remote* keyboard map. The local keyboard map is what really >> matters, and this should work fine with the remote shell enrivonment >> for any locale/language. > > Ok. What I want to be able to do is *occasionally* edit files in French > *remotely*. That's all. Then you don't have to change the 'remote' keymap. Especially not the remote *console* keymap. I'm often editing files in Greek (el_GR.ISO8859-7) over an SSH connection to a Solaris machine somewhere else. The setup I use is described below: [1] My .bashrc contains: ,----------------------------------------------------------------- | # 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 `----------------------------------------------------------------- This makes sure that bash (even the shell I'm using as a login shell before X11 fires up) knows that my local language environment is `el_GR.ISO8859-7', that it is ok to display characters from this locale (LC_CTYPE), and that I want sorting to be done according to the sorting rules of the `el_GR.ISO8859-7' locale. [2] I'm firing up X11 and I have made sure my .xinitrc file does not override the LANG or LC_XXX environment variables mentioned below. [3] My /etc/X11/xorg.conf contains: ,----------------------------------------------------------------- | Section "InputDevice" | Identifier "Keyboard0" | Driver "keyboard" | Option "XkbRules" "xorg" | Option "XkbModel" "pc105" | + | # Support for Greek input. You must also have a matching locale + | # setup in the environment of your xinit process. + | Option "XkbLayout" "us,el" + | Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll,compose:ralt" | EndSection `----------------------------------------------------------------- Note the lines marked with a '+'. These let my X11 desktop switch from Greek to English keyboard input, by hitting the left ALT and left SHIFT keys together. What characters are sent to applications is entirely a matter of this local setup, and is not really controlled by a remote server. For the remote server it doesn't really matter if you are typing on a keyboard, pasting text from a web browser, copying text using screen(1) from one terminal and pasting it to an ssh window, etc. Now, even with these three options, remote servers need just a small tweak to be able to 'read' what you sent over an SSH connection and correctly grok it as Greek (or French, in your case) text. They have to be notified that your locale permits these characters to be printed. This is done by setting in your *remote* .bashrc file the same locale environment variables: ,----------------------------------------------------------------- | # 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 `----------------------------------------------------------------- That is all it should take to let the remote server know that it is ok to display Greek characters. Some applications, i.e. bash(1) may need additional tweaks to allow input and/or display of 8-bit character sets (like Greek or French). For instance, in my .inputrc file (configuration file for the 'readline' library, and all the programs that use it; i.e. bash), I also have: ,----------------------------------------------------------------- | set convert-meta Off | set editing-mode emacs | set input-meta On | set output-meta On `----------------------------------------------------------------- This is present in all my .bashrc files (both local and remote ones). For reading, inputting and displaying French characters using an X11 desktop, you will have to do something similar, but `el_GR.ISO8859-7' will have to be replaced with one of the French locales. For reading, inputting and displaying French characters using a console session (i.e. one where your local system hasn't started X11 yet), you will have to do something similar *plus* change the *local* console keymap to support French input. The rest of the necessary settings for the environment and the LANG/LC_XXX values remain the same as in X11 (except, obviously, the ones inside `xorg.conf'). I hope this clarifies things a bit :) If not, feel free to provide us with more details about the setup you are trying to configure. - Giorgos