LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-16-2008, 02:02 PM   #1
pru
LQ Newbie
 
Registered: Feb 2008
Posts: 13

Rep: Reputation: 0
locale setting, problem with en_US.UTF-8


Hi experts!
I would appreciate any help on the issue:
I have installed libfacet - enchanced locale facets
from http://multitran.sourceforge.net/ with the oter dictionary files and as I understand it changed my locale.LC_ALL setting to en_US.UTF-8.
After reboot I get the following error from hplip:

Quote:
Starting hpssd: error: Unable to set locale.
Traceback (most recent call last):
File "./hpssd.py", line 63, in ?
from base.g import *
File "/usr/share/hplip/base/g.py", line 132, in ?
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
File "/usr/lib64/python2.4/locale.py", line 381, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
[FAILED]
and mozilla firefox stopped working properly after that - it just doesn't see internet connection.

How do I turn the changes made by libfacet back to defaults?
Thanks.
 
Old 04-17-2008, 02:48 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,643

Rep: Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812
You didn't mention your distro to be able to find the proper solution to your problem. You can search /etc/profile or look at the files under the dir /etc/profile.d to see where the locale variables are set. Locale can also be set at ~/.profile or ~/.bashrc, but this is per user setting and not global as in your case.

Regards
 
Old 04-17-2008, 01:38 PM   #3
pru
LQ Newbie
 
Registered: Feb 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
You didn't mention your distro to be able to find the proper solution to your problem. You can search /etc/profile or look at the files under the dir /etc/profile.d to see where the locale variables are set. Locale can also be set at ~/.profile or ~/.bashrc, but this is per user setting and not global as in your case.

Regards
Hi and thanks for assistance!
I'm using Scientific Linux 5.1, it is based on rhel5 I guess.
The lang.sh in profile.d contains the following code:

Quote:
if [ -n "$GDM_LANG" ]; then
sourced=1
LANG="$GDM_LANG"
unset LANGUAGE
if [ "$GDM_LANG" = "zh_CN.GB18030" ]; then
export LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
fi
fi
Quote:
if [ -n "$LC_ALL" ]; then
if [ "$LC_ALL" != "$LANG" ]; then
export LC_ALL
else
unset LC_ALL
fi
else
unset LC_ALL
fi
[ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
[ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
[ -n "$_XKB_CHARSET" ] && export _XKB_CHARSET || unset _XKB_CHARSET

consoletype=$(/sbin/consoletype)

if [ -n "$CHARSET" ]; then
case $CHARSET in
8859-1|8859-2|8859-5|8859-8|8859-15|koi*)
if [ "$TERM" = "linux" -a "$consoletype" = "vt" ]; then
echo -n -e '\033(K' 2>/dev/null > /proc/$$/fd/0
fi
;;
esac
elif [ -n "$SYSFONTACM" ]; then
case $SYSFONTACM in
iso01*|iso02*|iso05*|iso08*|iso15*|koi*|latin2-ucw*)
if [ "$TERM" = "linux" -a "$consoletype" = "vt" ]; then
echo -n -e '\033(K' 2>/dev/null > /proc/$$/fd/0
fi
;;
esac
fi
if [ -n "$LANG" ]; then
case $LANG in
*.utf8*|*.UTF-8*)
if [ "$TERM" = "linux" ]; then
if [ "$consoletype" = "vt" ]; then
case $LANG in
ja*) LANG=en_US.UTF-8 ;;
ko*) LANG=en_US.UTF-8 ;;
si*) LANG=en_US.UTF-8 ;;
zh*) LANG=en_US.UTF-8 ;;
en_IN*) ;;
*_IN*) LANG=en_US.UTF-8 ;;
esac
[ -x /bin/unicode_start ] && /sbin/consoletype fg && /bin/unicode_start $SYSFONT $SYSFONTACM
fi
fi
;;
*)
if [ "$TERM" = "linux" ]; then
if [ "$consoletype" = "vt" ]; then
case $LANG in
ja*) LANG=en_US ;;
ko*) LANG=en_US ;;
si*) LANG=en_US ;;
zh*) LANG=en_US ;;
en_IN*) ;;
*_IN*) LANG=en_US ;;
esac
[ -x /bin/unicode_stop ] && /sbin/consoletype fg && /bin/unicode_stop
fi
fi
;;
esac
fi

what do I have to change in the code to get back to the defaults?
And I dont know for sure what was the default language, could it be C?
I tried to change en_US.UTF-8 in lang.sh to en_US.utf8, because i found folder named en_US.utf8 in locale directory but there was no named en_US.UTF-8, and got the same error message after typing
service hplip restart.
Thanks.
 
Old 04-18-2008, 03:13 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,643

Rep: Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812Reputation: 1812
The lang.sh seems good. Are you sure that the software you've installed does not set LC_ALL in some other place, like a startup script or something? Usually LC_ALL is not set.
Anyway make a backup of lang.sh and change:
Quote:
if [ -n "$LC_ALL" ]; then
if [ "$LC_ALL" != "$LANG" ]; then
export LC_ALL
to
Code:
if [ -n "$LC_ALL" ]; then
if [ "$LC_ALL" != "$LANG" ]; then
unset LC_ALL
Logout and login again to see if it works.
 
Old 04-18-2008, 05:07 AM   #5
pru
LQ Newbie
 
Registered: Feb 2008
Posts: 13

Original Poster
Rep: Reputation: 0
I tried to change lang.sh the way you said, and I get the same error on hplip. I've removed the software with yum, so I can't find any startup scripts left by the software. My decigion is to reinstall linux, this way the problem will be solved for sure
Thank a lot for your help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Locale problem: Can't convert string from native encoding to 'UTF-8' treotan Ubuntu 1 11-14-2007 09:02 AM
Simplified Chinese in Qt apps under en_US.UTF-8? milkycow Slackware 1 05-25-2007 12:05 AM
Help needed with font installation on Debian 3.1 with locale all set to en_US.UTF-8 PhantmShado Linux - Software 1 02-20-2006 04:50 PM
locale is en_US.UTF-8, but gnome turns out to chinese envirement donkey301 Debian 1 03-02-2005 11:50 AM
X11 / UTF-8 locale seems missing 'fr_FR.UTF-8' chrsitophermann Debian 11 07-17-2004 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration