From owner-freebsd-questions Fri Jan 2 01:57:13 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id BAA21723 for questions-outgoing; Fri, 2 Jan 1998 01:57:13 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from polaris.we.lc.ehu.es (polaris.we.lc.ehu.es [158.227.6.43]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id BAA21699; Fri, 2 Jan 1998 01:56:49 -0800 (PST) (envelope-from jose@we.lc.ehu.es) Received: from we.lc.ehu.es by polaris.we.lc.ehu.es (SMI-8.6/SMI-SVR4) id KAA00460; Fri, 2 Jan 1998 10:56:38 +0100 Message-ID: <34ACB9BF.935CB4C3@we.lc.ehu.es> Date: Fri, 02 Jan 1998 10:56:15 +0100 From: "Jose M. Alcaide" Organization: Universidad del Pais Vasco - Dpto. de Electricidad y Electronica X-Mailer: Mozilla 4.04 [en] (X11; I; SunOS 5.5.1 sun4u) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG, pol@leissner.se, helbig@FreeBSD.ORG Subject: SOLVED: International characters in vi are displayed as hex? References: <348FB609.AE23FC54@we.lc.ehu.es> <34A929D6.120E7590@we.lc.ehu.es> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Jose M. Alcaide wrote: > > If compiled on FreeBSD, the call to setlocale() pass LC_ALL as > the first argument. I have tested this, and setlocale(LC_ALL,"") > works with most locales, but fails with a few ones: > > ascii > es_ES.ISO_8859-1 > fi_FI.ISO_8859-1 > ja_JP.EUC [also fails with setlocale(LC_CTYPE, "")] > ja_JP.SJIS [also fails with setlocale(LC_CTYPE, "")] > ko_KR.EUC [also fails with setlocale(LC_CTYPE, "")] > lt_LN.ASCII > lt_LN.ISO_8859-1 > lt_LN.ISO_8859-2 > nl_BE.ISO_8859-1 > sv_SE.ISO_8859-1 > us-ascii > > However, setlocale(LC_CTYPE, "") [_not_ LC_ALL] works fine with these > locales except the three noted. The vi problem is definitely solved. Indeed, the setlocale(LC_ALL,"") call in /usr/src/contrib/nvi/common/key.c fails because some locales are not fully described: Wolfgang Helbig wrote: > > That's because the file LC_TIME is missing in the directory > /usr/share/locale/es_ES.ISO_8859-1. If called with "LC_ALL", > setlocale(3) returns with an error ("No such file or directory") > without trying to load LC_CTYPE. > > So the fix is to provide a spanish LC_TIME file. You find sources > for other LC_TIME files in /usr/src/share/timedef/data. To build a > LC_TIME file from it's source, you only have to delete the comment > lines. This solution can be also applied to the other locales, such as sv_SE.ISO_8859-1. I have created the LC_TIME file for the spanish locale, and everything works fine now. Thanks Wolfgang! -- JM ----------------------------------------------------------------------- Jose M. Alcaide | mailto:jose@we.lc.ehu.es Universidad del Pais Vasco | http://www.we.lc.ehu.es/~jose Dpto. de Electricidad y Electronica | Facultad de Ciencias - Campus de Lejona | Tel.: +34-4-4647700 x2624 48940 Lejona (Vizcaya) - SPAIN | Fax: +34-4-4858139 ----------------------------------------------------------------------- "Go ahead... make my day." - H. Callahan