Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Problem with polish letters
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
pbm
n00b
n00b


Joined: 31 Oct 2007
Posts: 15

PostPosted: Tue Jan 14, 2014 6:09 pm    Post subject: [SOLVED] Problem with polish letters Reply with quote

After reinstalling my Gentoo I have a problem with making polish letters working again.

When I'm starting urxvt from awesome launcher I'm I can't type any polish letters and all messages with polish letters are not displayed correctly. If I open new urxvt window from that (urxvt) window everything is ok.
Next problem is that I'm getting following message from digikam:

Quote:
Your locale has changed since this album was last opened.
Old locale: UTF-8, new locale: ISO-8859-1


So there is something wrong with locale, but can't find the cause.


Code:
$ cat /etc/locale.gen
pl_PL.UTF-8 UTF-8
en_US.UTF-8 UTF-8


Code:
# locale-gen
 * Generating 2 locales (this might take a while) with 1 jobs
 *  (1/2) Generating pl_PL.UTF-8 ... [ ok ]
 *  (2/2) Generating en_US.UTF-8 ... [ ok ]
 * Generation complete


Code:
 $ locale -a
C
en_US.utf8
pl_PL.utf8
POSIX


Code:
$ locale
LANG=pl_PL.utf8
LC_CTYPE="pl_PL.utf8"
LC_NUMERIC="pl_PL.utf8"
LC_TIME="pl_PL.utf8"
LC_COLLATE="pl_PL.utf8"
LC_MONETARY="pl_PL.utf8"
LC_MESSAGES="pl_PL.utf8"
LC_PAPER="pl_PL.utf8"
LC_NAME="pl_PL.utf8"
LC_ADDRESS="pl_PL.utf8"
LC_TELEPHONE="pl_PL.utf8"
LC_MEASUREMENT="pl_PL.utf8"
LC_IDENTIFICATION="pl_PL.utf8"
LC_ALL=


Code:
$ eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   en_US.utf8
  [3]   pl_PL.utf8 *
  [4]   POSIX
  [ ]   (free form)


All bashrc and bash_profile are default.


Last edited by pbm on Sat Jan 18, 2014 2:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 541
Location: Germany

PostPosted: Wed Jan 15, 2014 7:51 am    Post subject: Reply with quote

Where do you set your locale? It might happen, that your shell picks up correct locale, but X (or awesome) when it starts picks up different locale. This could explain why first started urxvt sees different locale, like other programs started by awesome.
Back to top
View user's profile Send private message
pbm
n00b
n00b


Joined: 31 Oct 2007
Posts: 15

PostPosted: Wed Jan 15, 2014 9:12 pm    Post subject: Reply with quote

It's set using eselect locale set which modifies:

Code:
$ cat /etc/env.d/02locale
# Configuration file for eselect
# This file has been automatically generated.
LANG="pl_PL.utf8"


In both sessions locale is set in the same way (I started su to show you problem with polish letters):

urxvt from awesome launcher:
Code:
$ locale
LANG=pl_PL.utf8
LC_CTYPE="pl_PL.utf8"
LC_NUMERIC="pl_PL.utf8"
LC_TIME="pl_PL.utf8"
LC_COLLATE="pl_PL.utf8"
LC_MONETARY="pl_PL.utf8"
LC_MESSAGES="pl_PL.utf8"
LC_PAPER="pl_PL.utf8"
LC_NAME="pl_PL.utf8"
LC_ADDRESS="pl_PL.utf8"
LC_TELEPHONE="pl_PL.utf8"
LC_MEASUREMENT="pl_PL.utf8"
LC_IDENTIFICATION="pl_PL.utf8"
LC_ALL=
pbm@tauri ~ $ su -
HasÅo:
su: Nie można odzyskaÄ informacji uwierzytelniajÄcych


urxvt from urxvt:
Code:
$ locale
LANG=pl_PL.utf8
LC_CTYPE="pl_PL.utf8"
LC_NUMERIC="pl_PL.utf8"
LC_TIME="pl_PL.utf8"
LC_COLLATE="pl_PL.utf8"
LC_MONETARY="pl_PL.utf8"
LC_MESSAGES="pl_PL.utf8"
LC_PAPER="pl_PL.utf8"
LC_NAME="pl_PL.utf8"
LC_ADDRESS="pl_PL.utf8"
LC_TELEPHONE="pl_PL.utf8"
LC_MEASUREMENT="pl_PL.utf8"
LC_IDENTIFICATION="pl_PL.utf8"
LC_ALL=
pbm@tauri ~ $ su -
Hasło:
su: Nie można odzyskać informacji uwierzytelniających


EDIT: I compared output from env, export and set commands from both terminal. There are no differences except $SHLVL and $WINDOWID, which is normal.
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 541
Location: Germany

PostPosted: Thu Jan 16, 2014 7:45 am    Post subject: Reply with quote

The point is, when you run commands in shell, you see what the shell already has. But urxvt is started before shell, it launches shell after that and shell gets your environment settings.

Does awesome allow you to start arbitrary programs? If yes, then use awesome to launch some perl script which outputs environment into some file and then see what is in that file. Of course, you can use python or any other interpreter (not shell though :) )
Back to top
View user's profile Send private message
pbm
n00b
n00b


Joined: 31 Oct 2007
Posts: 15

PostPosted: Thu Jan 16, 2014 9:12 pm    Post subject: Reply with quote

So I started Python script (fragments):

Code:

import locale
f.write(str(locale.getlocale()))


Started from existing urxvt it gives me:
Code:
('pl_PL', 'UTF-8')


From awesome launcher I'm getting:
Code:
(None, None)


What should I do to get this working?
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 541
Location: Germany

PostPosted: Fri Jan 17, 2014 7:47 am    Post subject: Reply with quote

So, now you know that when awesome is started it does not see your locale settings, or it gets wrong ones from some other place. The next question is, how do you start awesome? Is it started from .xinitrc, or by some display manager? Which DM is that, which settings are used for DM? Or maybe awesome has its own way to configure locale, independent from environment, or maybe it has bug? Well the latter can be figured out by moving awesome binary and replacing it with python script that first writes locale info into file and then executes moved awesome binary. This way you'll know if environment that starts awesome contains correct settings. Most likely it does not, and then you'll have to answer all of the above questions :)
Back to top
View user's profile Send private message
pbm
n00b
n00b


Joined: 31 Oct 2007
Posts: 15

PostPosted: Sat Jan 18, 2014 2:27 pm    Post subject: Reply with quote

@v_andal: Thanks for your help... I solved it...

I was using slim to start awesome.

In slim config file (/etc/slim.conf) there is config option login_cmd which defines the command that slim should start. In my config file I used
Code:
login_cmd exec awesome

while correct solution is
Code:
login_cmd           /bin/bash -login /usr/share/slim/Xsession awesome


After the change everything is ok.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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