Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Going NUTS with locale settings

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

Going NUTS with locale settings

  • Quote

Post by tld » Fri Jan 17, 2014 1:38 am

I discovered today that on all three of my Gentoo machines, my locale looked like this:

Code: Select all

locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=
Due to a wanting I was getting in a mythtv utility, I came to find that was intended to be en_US.UTF-8 and NOT en_US.utf8. I've about lost my mind trying to correct this. Looking at the wiki:

https://wiki.gentoo.org/wiki/Localization/HOWTO

...I realized that I need to use eselect to select the locale and then use "env-update && source /etc/profile". Apparently I had never done so.

On the system I'm on right now that worked:

Code: Select all

locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
But on the other two this REFUSES to work, and I'm still getting ENV settings of en_US.utf8. I thought it may have had something to do with /etc/env.d/02locale, but I can see now that that simply has the en_US.utf8 name just as it appears in eselect:

Code: Select all

eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   en_US.utf8 *
  [3]   POSIX
  [ ]   (free form)
What on earth am I missing here??

Tom
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Fri Jan 17, 2014 2:13 am

OK...I was at least able to figure out the difference causing things to look correct on this machine. I had an additional file, /etc/env.d/99local that had:

Code: Select all

LANG="en_US.UTF-8"
But I'm still confused on this whole thing. If I manually change /etc/env.d/02locale to this:

Code: Select all

cat /etc/env.d/02locale
# Configuration file for eselect
# This file has been automatically generated.
LANG="en_US.UTF-8"
eselect shows the following:

Code: Select all

eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   en_US.utf8
  [3]   POSIX
  [4]   en_US.UTF-8 *
  [ ]   (free form)
...with the extra entry. I'm totally lost here. If the correct string is in fact UTF-8 (and everything seems to indicate that), and the local I generate with locale-gen is in fact en_US.UTF-8, what's with the default en_US.utf8, and what is the "correct" way to do this??

Craziness...

Tom
Top
VoidMage
Watchman
Watchman
User avatar
Posts: 6196
Joined: Sat Oct 14, 2006 8:43 am

  • Quote

Post by VoidMage » Fri Jan 17, 2014 5:35 am

tld wrote: en_US.UTF-8 and NOT en_US.utf8
Usually, one is an alias of the other, so there should be no difference in using either.
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Fri Jan 17, 2014 2:04 pm

VoidMage wrote:
tld wrote: en_US.UTF-8 and NOT en_US.utf8
Usually, one is an alias of the other, so there should be no difference in using either.
That doesn't appear to necessarily be the case. The utf8 version was not being recognized by programs in MythTV, and given that everything else involved such as /usr/share/i18n/charmaps/UTF-8.gz as well as all the local-gen stuff uses the UTF-8 name, I'm inclined to think they have it right.

I don't get where the "utf" name even comes from. It doesn't seem to appear anywhere except as a default option in eselect.

Tom
Top
v_andal
Guru
Guru
Posts: 549
Joined: Tue Aug 26, 2008 4:25 pm
Location: Germany

  • Quote

Post by v_andal » Mon Jan 20, 2014 10:00 am

Well. I guess it comes from 'locale -a' command. At least on my system with only 'en_US.UTF-8 UTF-8' in /etc/locale.gen I get
C
POSIX
en_US.utf8
I've created 02locale manually with 'LANG=en_US.UTF-8', so 'eselect locale list' gives me
[1] C
[2] POSIX
[3] en_US.utf8
[4] en_US.UTF-8 *
[ ] (free form)
Everything works fine, so I've never bothered figuring out, why "locale -a" gives such name.
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Mon Jan 20, 2014 3:12 pm

v_andal wrote: Everything works fine, so I've never bothered figuring out, why "locale -a" gives such name.
I never noticed that. That is a strange one. A few checks on other (non-Gentoo) systems I have access to seems to indicate that "locale -a" always uses those <lang>.utf8 names, even though the actual codeset files are named UTF-8.

Tom
Top
Post Reply

6 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy