You are not logged in.

#1 2013-09-30 13:03:41

stozi
Member
Registered: 2010-03-02
Posts: 149

[Solved] UTF-8 locale-gen not working

$ cat /etc/locale.conf
Lang=en_CA.UTF-8
$ locale -a
C
POSIX
en_CA.utf8
$ locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=
$ cat /etc/profile.d/locale.sh
#!/bin/sh

unset LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES \
          LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT"LC_IDENTIFICATION

if [ -n "$XDG_CONFIG_HOME" ] && [ -r  "XDG_CONFIG_HOME/locale.conf" ]; then
  . "$XDG_CONFIG_HOME/locale.conf"
elif [ -n $HOME ] && [ -r $HOME/.config/locale.conf ]; then
  . "$HOME/.config/locale.conf"
elif [ -r /etc/locale.conf ]; then
 . /etc/locale.conf
elif [ -r /etc/rc.conf ]; then
  LANG=$(. /etc/rc.conf 2>/dev/null; echo "$LOCALE")
fi

export LANG="${LANG:-C}"
[ -n "$LC_CTYPE" ]          $$ export LC_CTYPE
[ -n "$LC_NUMERIC" ]        $$ export LC_NUMERIC
[ -n "$LC_TIME" ]           $$ export LC_TIME
[ -n "$LC_COLLATE" ]        $$ export LC_COLLATE
[ -n "$LC_MONETARY" ]       $$ export LC_MONETARY
[ -n "$LC_MESSAGES" ]       $$ export LC_MESSAGES
[ -n "$LC_PAPER" ]          $$ export LC_PAPER
[ -n "$LC_NAME" ]           $$ export LC_NAME
[ -n "$LC_ADDRESS" ]        $$ export LC_ADDRESS
[ -n "$LC_TELEPHONE" ]      $$ export LC_TELEPHONE
[ -n "$LC_MEASUREMENT" ]    $$ export LC_MEASUREMENT
[ -n "$LC_IDENTIFICATION" ] $$ export LC_IDENTIFICATION

So how to get en_CA.UTF-8 in effect? And why isn't in effect automatically? I installed recently and followed the locale-gen procedure. Only graphical stuff installed is i3, qupzilla & smplayer, no gnome or anything. I guess it's not related, but Dvorak layout is working as per vconsole.conf. Thanks

Last edited by stozi (2013-09-30 14:33:29)

Offline

#2 2013-09-30 13:11:11

XURL
Member
Registered: 2013-09-26
Posts: 24

Re: [Solved] UTF-8 locale-gen not working

/etc/loacle.conf should be:

LANG="en_CA.UTF-8"

Edit it and reboot.


☑ CPU: Single core Intel Pentium M (-UP-) clocked at 1733.000 Mhz
☑ MEM: 490.1 MB
☑ HDD: 40.1 GB

Offline

#3 2013-09-30 13:28:33

stozi
Member
Registered: 2010-03-02
Posts: 149

Re: [Solved] UTF-8 locale-gen not working

Thanks, so now

$ locale -a
C
en_CA.utf8
POSIX

is normal? if I never manually edited /etc/locale.conf, how did it get wrong?

Offline

#4 2013-09-30 13:37:30

XURL
Member
Registered: 2013-09-26
Posts: 24

Re: [Solved] UTF-8 locale-gen not working

locale -a lists all available locales, not the ones being used.

Last edited by XURL (2013-09-30 13:37:41)


☑ CPU: Single core Intel Pentium M (-UP-) clocked at 1733.000 Mhz
☑ MEM: 490.1 MB
☑ HDD: 40.1 GB

Offline

#5 2013-09-30 13:44:03

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] UTF-8 locale-gen not working

What's the output of 'locale'?
You should read the wiki on how to set up or modify the locale.

Offline

#6 2013-09-30 14:17:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,332
Website

Re: [Solved] UTF-8 locale-gen not working

Specifically, see the parts about /etc/locale.gen and locale-gen in the wiki.  I don't know if that's where the problem is, but as you've posted no information about those steps, I'm betting that is what was missed.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2013-09-30 14:20:32

stozi
Member
Registered: 2010-03-02
Posts: 149

Re: [Solved] UTF-8 locale-gen not working

thanks I have read it, didn't find anything that would help. still want to know how my /etc/locale.conf could have the wrong formating when it's never been manually edited.

locale now outputs en_CA.UTF-8 for LANG and all the LCs except empty LC_ALL

Offline

#8 2013-09-30 14:27:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,332
Website

Re: [Solved] UTF-8 locale-gen not working

stozi wrote:

thanks I have read it, didn't find anything that would help. still want to know how my /etc/locale.conf could have the wrong formating when it's never been manually edited.

Asked and answered.  You need to edit that file - this is described in the Beginners guide and installation guide (edit: and several times on the locale page).

Last edited by Trilby (2013-09-30 14:29:04)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2013-09-30 14:29:04

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] UTF-8 locale-gen not working

Have you followed the installation or beginners guide from the wiki?
There's a step about the locales.

Offline

#10 2013-09-30 14:33:00

stozi
Member
Registered: 2010-03-02
Posts: 149

Re: [Solved] UTF-8 locale-gen not working

Ok I see, ADHD moment when I did

# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8

thanks

Offline

Board footer

Powered by FluxBB