From owner-freebsd-questions Sat Jan 19 2:55:12 2002 Delivered-To: freebsd-questions@freebsd.org Received: from richard.eu.org (adsl-213-190-39-118.takas.lt [213.190.39.118]) by hub.freebsd.org (Postfix) with ESMTP id 3DB9637B400 for ; Sat, 19 Jan 2002 02:54:22 -0800 (PST) Received: (from rch@localhost) by richard.eu.org (8.11.0/8.11.6) id g0JAsF635832 for freebsd-questions@freebsd.org; Sat, 19 Jan 2002 12:54:15 +0200 (EET) (envelope-from rch@richard.eu.org) Date: Sat, 19 Jan 2002 12:54:14 +0200 From: Richard =?utf-8?B?xIxlcGFz?= To: freebsd-questions@freebsd.org Subject: Re: utf-8 locales in freebsd ? Message-ID: <20020119105414.GR77146@richard.eu.org> References: <20020119063710.GA2750@foo31-249.visit.se> <20020119093102.GO77146@richard.eu.org> <20020119102224.GA6408@foo31-249.visit.se> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20020119102224.GA6408@foo31-249.visit.se> User-Agent: Mutt/1.3.25i X-OS: FreeBSD 4.5-RC i386 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat Jan 19 11:22:24 2002 +0100 Martin Karlsson wrote: >Hi! I lost you halfway trough, hope you don't mind helping me out :) > >On Sat Jan 19, 2002 at 11:31:02AM +0200, Ricardas Cepas wrote: >[...snip...] >> You need to do something like this using your locale name, LOCALEDIR is >> /usr/share/locale: >> install -d ${LOCALEDIR}/lt_LT.UTF-8/ >> ln -fs ../la_LN.ASCII/LC_COLLATE ${LOCALEDIR}/lt_LT.UTF-8/LC_COLLATE >> mklocale -o ${LOCALEDIR}/lt_LT.UTF-8/LC_CTYPE attached_file/lt_LT.UTF-8.src >> grep -v '^#' >> ${LOCALEDIR}/lt_LT.UTF-8/LC_TIME >[...snip...] > >I successfully made it up to "grep -v '^#'". The output of that command >appears to be... well, nothing. I'm pretty sure I've misunderstood you. > >Then, after having converted /usr/share/locale/sv_SE.ISO_8859-1/LC_TIME >(iconv -f iso-8859-1 -t utf-8 ...LC_CTIME > sv.SE.UTF-8.src.new), I >understood I was supposed to run the above "mklocale..."-command (with >LC_TIME instead of LC_COLLATE). When I try that, I get "Lex is >skipping...[one char at the time], syntax error. > >Please help me get back on track! > Here is my commands another way around: /home/rch #su3# mkdir /usr/share/locale/sv_SE.UTF-8 /home/rch #su3# iconv -f iso-8859-1 -t utf-8 /usr/share/locale/sv_SE.UTF-8/LC_TIME /home/rch #su3# LANG=sv_SE.UTF-8 date Lör 19 Jan 2002 12:37:46 EET # now we have date working. Note - the above command output may look with to characters instead of accented o if you terminal is iso 8859-1. If you have FreeBSD before 4.5, your locale is named sv_SE.ISO_8859-1, not sv_SE.ISO8859-1 # Going with LC_CTYPE, assuming that you have saved ctype source file I had attached in previous messate in /tmp/ /home/rch #su3# mklocale -o /usr/share/locale/sv_SE.UTF-8/LC_CTYPE /tmp/lt_LT.UTF-8.src /home/rch #su3# echo $? 0 # it ok, now we need LC_COLLATE but FreeBSD don't have it for multibyte locales, so do fake symlink instead: /home/rch #su3# ln -fs ../la_LN.ASCII/LC_COLLATE /usr/share/locale/sv_SE.UTF-8/LC_COLLATE /home/rch #su3# ls -l /usr/share/locale/sv_SE.UTF-8/ total 273 lrwxrwxr-x 1 root wheel 25 Sau 19 12:46 LC_COLLATE@ -> ../la_LN.ASCII/LC_COLLATE -rw-rw-r-- 1 root wheel 264323 Sau 19 12:44 LC_CTYPE -rw-rw-r-- 1 root wheel 373 Sau 19 12:37 LC_TIME Now try something: /home/rch #su3# LANG=sv_SE.UTF-8 gimp Hmm, it messages doesn't look good in different charset.. You need to install devel/gettext-devel: /usr/ports/devel/gettext-devel #su3# cd /usr/ports/devel/gettext-devel/ /usr/ports/devel/gettext-devel #su3# make WANT_FULL_GETTEXT=1 /usr/ports/devel/gettext-devel #su3# make install WANT_FULL_GETTEXT=1 Now edit /usr/local/share/gettext/intl/config.charset and add: sv_SE.UTF-8 UTF-8 in that file, the library accompanying gnu gettext is dumb enough not figure that from LANG. Enjoy! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message