Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jan 2002 11:31:02 +0200
From:      Richard =?utf-8?B?xIxlcGFz?= <rch@richard.eu.org>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: utf-8 locales in freebsd ?
Message-ID:  <20020119093102.GO77146@richard.eu.org>
In-Reply-To: <20020119063710.GA2750@foo31-249.visit.se>
References:  <20020119063710.GA2750@foo31-249.visit.se>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Sat Jan 19 07:37:11 2002 +0100 Martin Karlsson wrote:

>Hi list. Is there such a thing as UTF-8 locales for freebsd?
>
>I have utf fonts, but, changing my LC_CTYPE from sv_SE.DIS_8859-15 to
>sv_SE.UTF-8 doesn't seem to do what I want; it results in me no longer
>being able to type Swedish national chars.
>
>Anyone know about this?
>
        Hi,

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 '^#' <your_date_definition_file_converted_with_iconv_to_utf-8_lt_LT.UTF-8.src.new >${LOCALEDIR}/lt_LT.UTF-8/LC_TIME

Making 0x80 - 0x9F characters printable probably is not needed, but I'm not sure.
This doesn't add complete wchar functions set, but most programs do not require this.  It works with xterm, KDE (after editing ~/.kde/share/config/kdeglobals & ~/.kde/share/config/kxkbrc), vim 6, gimp, mozilla (after editing /usr/X11R6/lib/mozilla/res/unixcharset.properties).
It's a pity most unices have utf-8 locales out of the box but not *BSD.

-- 
      ☻ Ričardas Čepas ☺
http://unicode.richard.eu.org/me/rch/ll.html

[-- Attachment #2 --]
/*
 * LOCALE_CTYPE for the UTF-8 Locale
 *
 *	$Id: lt_LT.UTF-8.src,v 1.0 1998/07/23 15:21:39 rch Exp $
 */

ENCODING	"UTF2"
VARIABLE        ISO 10646 character set

#
# This is a comment
#
ALPHA		'A' - 'Z' 'a' - 'z' 
CONTROL		0x00 - 0x1f 0x7f
DIGIT		'0' - '9'
GRAPH		0x21 - 0x7e 0x80 - 0xffff
LOWER		'a' - 'z' 
PUNCT		0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e 
		0xa4 0xa7 0xa8 0xad 0xaf 0xb0 0xb2 0xb4 0x2c7 0xb8
		0xd7 0xf7 0x2d9 0x2010 -0x2044
SPACE		0x09 - 0x0d 0x20 0xa0 0x2002 - 0x2006 0x2009 0x200a
UPPER		'A' - 'Z' 
XDIGIT		'a' - 'f' 'A' - 'F'
BLANK		' ' '\t' 0xa0
PRINT		0x20 - 0x7e 0xa0 - 0xffff
# IDEOGRAM
# SPECIAL
# PHONEGRAM

MAPLOWER       	<'A' - 'Z' : 'a'>
MAPLOWER       	<'a' - 'z' : 'a'>
MAPUPPER       	<'A' - 'Z' : 'A'>
MAPUPPER       	<'a' - 'z' : 'A'>
TODIGIT       	<'0' - '9' : 0>
TODIGIT       	<'A' - 'F' : 10>
TODIGIT       	<'a' - 'f' : 10>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020119093102.GO77146>