Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problems with locales
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
tkhobbes
Guru
Guru


Joined: 12 Nov 2004
Posts: 367
Location: Switzerland

PostPosted: Tue Nov 01, 2005 10:03 am    Post subject: Problems with locales Reply with quote

Hi there

I was not sure where to post this, so feel free to move... :)

Anyway, I have some problems with my locales; I wanted to migrate to UTF-8, as written in this superb doc: http://www.gentoo.org/doc/en/utf-8.xml.

I want to have an "en_US.UTF-8" locale, but here's the outputs I get:

Code:

thomas@linux ~ $ locale -a | grep 'en_US'
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory

thomas@linux ~ $ sudo localedef -i en_US -f UTF-8 en_US.UTF-8
cannot read character map directory `/usr/share/i18n/charmaps': No such file or directory


What's wrong?

thanks
thomas
_________________
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Back to top
View user's profile Send private message
tkhobbes
Guru
Guru


Joined: 12 Nov 2004
Posts: 367
Location: Switzerland

PostPosted: Tue Dec 20, 2005 8:47 am    Post subject: Reply with quote

Anyone?

:oops:
_________________
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Back to top
View user's profile Send private message
morodoch
Guru
Guru


Joined: 22 Sep 2005
Posts: 523
Location: England

PostPosted: Tue Dec 20, 2005 8:59 am    Post subject: Reply with quote

I followed the howto on the wiki:

Code:
http://gentoo-wiki.com/HOWTO_Create_an_UTF-8_enabled_system


It worked for en_GB, so it may work for en_US :)
_________________
Well, the Sister was right. You boys could use a little churching up. Slide on down to the Triple Rock, and catch Rev. Cleophus. You boys listen to what he's got to say.

-- Curtis
Back to top
View user's profile Send private message
Cintra
Advocate
Advocate


Joined: 03 Apr 2004
Posts: 2111
Location: Norway

PostPosted: Tue Dec 20, 2005 9:13 am    Post subject: Reply with quote

do you have this in:
Code:
# cat /etc/locales.build
# This file names the list of locales to be built when glibc is installed.
# The format is <locale>/<charmap>, where <locale> is a locale from the
# /usr/share/i18n/locales directory, and <charmap> is name of one of the files
# in /usr/share/i18n/charmaps/. All blank lines and lines starting with # are
# ignored. Here is an example:
# en_US/ISO-8859-1
en_US/ISO-8859-1
en_US.UTF-8/UTF-8

and
Code:
# cat /etc/env.d/02locale
LC_ALL="en_US.utf8"

and do you have the userlocales USE flag for glibc?
and finally do you have the /usr/share/i18n/charmaps directory?
Mvh
_________________
"I am not bound to please thee with my answers" W.S.
Back to top
View user's profile Send private message
morodoch
Guru
Guru


Joined: 22 Sep 2005
Posts: 523
Location: England

PostPosted: Tue Dec 20, 2005 9:20 am    Post subject: Reply with quote

Code:
% cat /etc/locales.build
# This file names the list of locales to be built when glibc is installed.
# The format is <locale>/<charmap>, where <locale> is a locale from the
# /usr/share/i18n/locales directory, and <charmap> is name of one of the files
# in /usr/share/i18n/charmaps/. All blank lines and lines starting with # are
# ignored. Here is an example:
# en_US/ISO-8859-1

en_US/ISO-8859-1
en_US.UTF-8/UTF-8
ja_JP.EUC-JP/EUC-JP
ja_JP.UTF-8/UTF-8
ja_JP/EUC-JP
en_HK/ISO-8859-1
en_PH/ISO-8859-1
de_DE/ISO-8859-1
de_DE@euro/ISO-8859-15
es_MX/ISO-8859-1
fa_IR/UTF-8
fr_FR/ISO-8859-1
fr_FR@euro/ISO-8859-15
it_IT/ISO-8859-1
en_GB/ISO-8859-1
en_GB.UTF-8/UTF-8


Code:
% cat /etc/env.d/02locale
LANG="en_GB.utf8"
LANGUAGE="en_GB.utf8"
LC_ALL="en_GB.utf8"


Code:
# emerge -pv glibc

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] sys-libs/glibc-2.3.5-r2  -build -erandom -glibc-compat20 -glibc-omitfp -hardened -linuxthreads-tls (-multilib) +nls +nptl -nptlonly +pic -profile (-selinux) +userlocales 0 kB


Code:
# ls -ld /usr/share/i18n/charmaps
drwxr-xr-x  2 root root 7048 Dec  4 12:08 /usr/share/i18n/charmaps


HTH
_________________
Well, the Sister was right. You boys could use a little churching up. Slide on down to the Triple Rock, and catch Rev. Cleophus. You boys listen to what he's got to say.

-- Curtis
Back to top
View user's profile Send private message
tkhobbes
Guru
Guru


Joined: 12 Nov 2004
Posts: 367
Location: Switzerland

PostPosted: Tue Dec 20, 2005 10:59 am    Post subject: Reply with quote

Thanks for this; I adapted everything to my needs, so here's my /etc/locales.build:

Code:

de_CH.UTF-8/UTF-8
en_US.UTF-8/UTF-8
en_US/ISO-8859-1
de_DE@euro/ISO-8859-15


Here's my /etc/env.d/02locale:

Code:

LANG="en_US.utf8"
LANGUAGE="en_US.utf8"
LC_ALL="en_US.utf8"


And here's the output of emerge -pv glibc:
Code:

[ebuild   R   ] sys-libs/glibc-2.3.5-r2  +build -erandom -glibc-compat20 -glibc-omitfp -hardened -linuxthreads-tls (-multilib) +nls -nptl -nptlonly -pic -profile (-selinux) +userlocales 0 kB


Now, I re-emerged glibc, but when issueing the last command, ls -ld /usr/share/i18n/charmaps, I get this:
Code:

ls: /usr/share/i18n/charmaps: No such file or directory


:-(

EDIT: I also saw the output of some glibc-emerge task:

Code:
>>> original instance of package unmerged safely.
//usr/sbin/iconvconfig: cannot open `//usr/lib/gconv/gconv-modules': No such file or directory
//usr/sbin/iconvconfig: no output file produced because warning were issued


I don't know what this means, as it is at the end of the emerge and it did not return an error...

thomas
_________________
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Back to top
View user's profile Send private message
Cintra
Advocate
Advocate


Joined: 03 Apr 2004
Posts: 2111
Location: Norway

PostPosted: Tue Dec 20, 2005 11:18 am    Post subject: Reply with quote

the difference between your emerge -vp glibc and mine seems to be +nptl:
Code:
# emerge -pv glibc
These are the packages that I would merge, in order:
Calculating dependencies ...done!
[ebuild   R   ] sys-libs/glibc-2.3.5-r2  USE="-build -erandom -glibc-compat20 -glibc-omitfp -hardened -linuxthreads-tls +nls +nptl -nptlonly -pic -profile +userlocales" 0 kB

Quote:
nptl Enable support for Native POSIX Threads Library, the new threading module (requires linux-2.6 or better usually)
btw, adding nptl to your make.conf USE flags will result in glibc being emerged twice each time.
Though I'm not 100% sure that is your problem. Do you also have unicode in your USE flags?
Mvh

Edit: what kernel are you using?
Oh, and another thing +build? where did that come from?
Quote:
build !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping

_________________
"I am not bound to please thee with my answers" W.S.
Back to top
View user's profile Send private message
tkhobbes
Guru
Guru


Joined: 12 Nov 2004
Posts: 367
Location: Switzerland

PostPosted: Tue Dec 20, 2005 1:53 pm    Post subject: Reply with quote

Added nptl, re-emerged, nothing changed.

I don't know where the build comes from; I now explicitily excluded it via "-build" in /etc/make.conf (however, it still showes up when issueing "emerge -pv glibc" - there is still a +build....)

Kernel-Version is 2.6.14-gentoo-r5

thomas
_________________
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Back to top
View user's profile Send private message
Cintra
Advocate
Advocate


Joined: 03 Apr 2004
Posts: 2111
Location: Norway

PostPosted: Tue Dec 20, 2005 2:04 pm    Post subject: Reply with quote

there is possibly a shorter solution but I know what I would do in your place..
rebuild the toolchain and do an 'emerge -e system'
...after taking a full backup of course!
;-)

Edit: could be an idea to list your 'emerge info' here as someone else may notice something.
Have you a copy of emwrap http://www3.telus.net/dol-sen/linux/
That would simplify toolchain rebuilding with for example 'emwrap -pet'
_________________
"I am not bound to please thee with my answers" W.S.
Back to top
View user's profile Send private message
morodoch
Guru
Guru


Joined: 22 Sep 2005
Posts: 523
Location: England

PostPosted: Tue Dec 20, 2005 2:28 pm    Post subject: Reply with quote

I don't understand this, the /usr/share/i18n/charmaps directory definitely was installed by my glibc emerge. I don't know if this helps, but you can build the locales files after installing glibc, see here:

http://www.tldp.org/LDP/lfs/html/chapter05/glibc.html
_________________
Well, the Sister was right. You boys could use a little churching up. Slide on down to the Triple Rock, and catch Rev. Cleophus. You boys listen to what he's got to say.

-- Curtis
Back to top
View user's profile Send private message
tkhobbes
Guru
Guru


Joined: 12 Nov 2004
Posts: 367
Location: Switzerland

PostPosted: Tue Dec 20, 2005 3:08 pm    Post subject: Reply with quote

The page from LFS is neat - but the localedef command does not work:
Code:

linux ~ # localedef -i en_US -f UTF-8 en_US.UTF-8
cannot read character map directory `/usr/share/i18n/charmaps': No such file or directory


Here's my emerge info:

Code:

Portage 2.0.51.22-r3 (default-linux/x86/2005.0, gcc-3.3.6, glibc-2.3.5-r2, 2.6.14-gentoo-r2 i686)
=================================================================
System uname: 2.6.14-gentoo-r2 i686 Intel(R) Celeron(R) CPU 2.40GHz
Gentoo Base System version 1.6.13
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -march=pentium4"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.mirror.solnet.ch http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://pandemonium.tiscali.de/pub/gentoo/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 a52 aac aalib acpi alsa apache2 apm audiofile avi bash-completion berkdb bitmap-fonts bzip2 bzlib cdda cdr crypt cups curl dvd eds emboss encode exif expat fbcon ffmpeg flac foomaticdb fortran ftp gd gdbm gif gmp gpm gstreamer httpd imagemagick imap imlib ipv6 jpeg ldap libg++ libwww mad maildir math mhash mikmod mime mmx mp3 mpeg mysql ncurses nls nptl ogg oggvorbis pam pcre pdflib perl php png ppds python quicktime readline samba sasl scanner sdl spell ssl svga symlink tcpd tetex tidy tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales vcd vlm vorbis xml xml2 xsl xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

_________________
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Back to top
View user's profile Send private message
Cintra
Advocate
Advocate


Joined: 03 Apr 2004
Posts: 2111
Location: Norway

PostPosted: Tue Dec 20, 2005 5:58 pm    Post subject: Reply with quote

I wonder if this can be a kernel problem.. I have this (edited) in my .config file
Code:
#
# Native Language Support
#
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
CONFIG_NLS_CODEPAGE_850=m
# CONFIG_NLS_CODEPAGE_852 is not set
...
# CONFIG_NLS_CODEPAGE_864 is not set
CONFIG_NLS_CODEPAGE_865=m
# CONFIG_NLS_CODEPAGE_866 is not set
...
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
CONFIG_NLS_ASCII=m
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
...
# CONFIG_NLS_ISO8859_14 is not set
CONFIG_NLS_ISO8859_15=y
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
CONFIG_NLS_UTF8=y

How does that compare?
_________________
"I am not bound to please thee with my answers" W.S.
Back to top
View user's profile Send private message
tkhobbes
Guru
Guru


Joined: 12 Nov 2004
Posts: 367
Location: Switzerland

PostPosted: Tue Dec 20, 2005 7:02 pm    Post subject: Reply with quote

Here is the part from my config-file:

Code:

CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
CONFIG_NLS_CODEPAGE_850=y
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
CONFIG_NLS_UTF8=y


I think it is ok...
_________________
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Back to top
View user's profile Send private message
Cintra
Advocate
Advocate


Joined: 03 Apr 2004
Posts: 2111
Location: Norway

PostPosted: Tue Dec 20, 2005 7:16 pm    Post subject: Reply with quote

It looks ok to me but if you want utf-8 you need to change the value of this line to
Code:
CONFIG_NLS_DEFAULT="utf8"

and the usual 'make && make modules_install' etc.
mvh
_________________
"I am not bound to please thee with my answers" W.S.
Back to top
View user's profile Send private message
morodoch
Guru
Guru


Joined: 22 Sep 2005
Posts: 523
Location: England

PostPosted: Wed Dec 21, 2005 9:50 am    Post subject: Reply with quote

Quote:
linux ~ # localedef -i en_US -f UTF-8 en_US.UTF-8
cannot read character map directory `/usr/share/i18n/charmaps': No such file or directory


This is *really* weird - this directory was also installed by my emerge of glibc. I don't understand how we could have almost the same USE flags and I end up with a couple of system directories you don't have. (The nptl is for threading, and nothing to with NLS AFAIK.)

As far as the kernel config goes, you'll need to do this to get utf8 in your filesystems, I think, but I don't think it should affect your userspace stuff - unless glibc is a special case?

Curiouser and curiouser...
_________________
Well, the Sister was right. You boys could use a little churching up. Slide on down to the Triple Rock, and catch Rev. Cleophus. You boys listen to what he's got to say.

-- Curtis
Back to top
View user's profile Send private message
tkhobbes
Guru
Guru


Joined: 12 Nov 2004
Posts: 367
Location: Switzerland

PostPosted: Thu Dec 22, 2005 6:55 pm    Post subject: Reply with quote

I have another gentoo box (a client, the one having problems is really a server) - could I just copy the missing directory over?
_________________
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Back to top
View user's profile Send private message
morodoch
Guru
Guru


Joined: 22 Sep 2005
Posts: 523
Location: England

PostPosted: Thu Dec 22, 2005 9:51 pm    Post subject: Reply with quote

I don't really know, but it could be worth a try - the files don't *look* architecture specific.
_________________
Well, the Sister was right. You boys could use a little churching up. Slide on down to the Triple Rock, and catch Rev. Cleophus. You boys listen to what he's got to say.

-- Curtis
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum