You are not logged in.

#1 2013-12-09 04:32:18

jwhendy
Member
Registered: 2010-04-01
Posts: 621

[SOLVED] /etc/locale.gen seems to be ignored by localectl

I'm having a very similar issue to the one described HERE. His/hers was magically resolved, so I don't know how to proceed in troubleshooting.

$ cat /etc/locale.gen
en_US.UTF-8 UTF-8  
en_US ISO-8859-1

$ sudo locale-gen
Generating locales...
  en_US.UTF-8
  en_US.ISO-8859-1
Generation complete.

[ Just in case this was an update issue (system files recently updated not being found or something), I rebooted ]

$ 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=

$ locale -a
C
POSIX
en_US
en_US.iso88591
en_US.utf8

$ localectl status
   System Locale: n/a

       VC Keymap: n/a
      X11 Layout: n/a

I see that localctl can be used to set one's default locale in Arch, but wiki doesn't seem to indicate that this must be done unless I missed something. From my read, it seemed like /etc/locale.gen, followed by locale-gen should do it.

Something's clearly funky, but I don't know what it is. I've not changed anything related to this in a while and have not had problems in the past. I was only prompted to check into this, as I just had a weird experience with a character in a data file. It looked like a hyphen but when searching for hyphens and typing one in to match, there were no results. The hyphen I see and the output of typing one are not matching... but strangely, copying/pasting what I see and typing one suddenly become identical. Hoping it's related to the above.

Last edited by jwhendy (2013-12-09 15:53:47)

Offline

#2 2013-12-09 04:37:29

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

Re: [SOLVED] /etc/locale.gen seems to be ignored by localectl

jwhendy wrote:

I see that localctl can be used to set one's default locale in Arch, but wiki doesn't seem to indicate that this must be done unless I missed something. From my read, it seemed like /etc/locale.gen, followed by locale-gen should do it.

Use either localectl or /etc/locale.conf. The wiki is pretty clear about it.
AFAICT you used neither.

You should check e.g. the unicode value for this "hyphen" - it can be an n-dash, m-dash etc.

Offline

#3 2013-12-09 04:38:15

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] /etc/locale.gen seems to be ignored by localectl

You didn't make the /etc/locale.conf file.


Edit: Damn, karol is quick.  After realizing I had been beat and rescanning the post, I think the wiki is indicating that localectl is an optional way to set /etc/locale.conf, but one way or another, it needs to me made.

Last edited by WonderWoofy (2013-12-09 04:41:05)

Offline

#4 2013-12-09 15:53:33

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: [SOLVED] /etc/locale.gen seems to be ignored by localectl

@karol/WonderWoofy: you are correct. I just did Ctrl-F for localectl and looked at the first hit:

You can set the default locale in locale.conf also using localectl, for example:

The use of "can" led me to think it wasn't mandatory or that setting a default locale was more for changing away from the current default or some special ability that wasn't needed in any case. More careful reading would have led to me finding this at the beginning of that section:

Note: /etc/locale.conf does not exist by default and must be created manually.

My bad, and you put it exactly right, WonderWoofy: one can use either method, but one must use one of them, which I missed due to my cherry picking on the hunt for an obvious solution or statement about needing localectl. I've now done this:

$ sudo localectl set "LANG=en_US.utf8"

$ localectl status
   System Locale: LANG=en_US.utf8
       VC Keymap: n/a
      X11 Layout: n/a

$ ls /etc/locale.conf
/etc/locale.conf

All appears to be right with the world now.

-----

And, regarding my hyphen "error," turns out it was all silliness. I was using R on a data set provided by someone else and the variable names had hyphens in them. I'd go to auto-complete in Emacs/ESS by typing the first part of the name, and then TAB to see the list of possible completions. If I stopped before the hyphen, Emacs would spit out all possible names... and it's Emacs that makes the next possible character bold, which I thought was showing me a different character than a hyphen!

So... I'd type a hyphen and hit TAB again to see the new, filtered list of completions... and none would be listed. That was due to R not being able to differentiate between me trying to type a variable name or trying to subtract to variables! Thus, it wouldn't complete a list of column names since it thought I was entering a math equation. Calling the variable names within quotes worked fine.

So... all a fluke, but I'm glad I got this sorted out now anyway. Marking as solved and many thanks for the quick reply, especially given that I made a rookie mistake that was clearly spelled out in the Wiki.

Offline

Board footer

Powered by FluxBB