LinuxQuestions.org
Help answer threads with 0 replies.
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 02-04-2010, 12:42 AM   #1
ee5
LQ Newbie
 
Registered: Feb 2010
Posts: 2

Rep: Reputation: 0
setlocale problem


Hi,

I am trying to setlocale on ppc, but due to memory shortage the locale package is not installed completely- only the related files are copied. There may be a missing file but I cannot find which is. The simple test code below does not work and prints error message.

int main()
{
if ( setlocale(LC_COLLATE,"tr_TR") == NULL )
printf("could not set locale\n");
return 0;
}

strace output is as follows.


open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2601, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30000000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2601
read(3, "", 4096) = 0
close(3) = 0
munmap(0x30000000, 4096) = 0
open("/usr/lib/locale/tr_TR/LC_COLLATE", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=22471, ...}) = 0
mmap(NULL, 22471, PROT_READ, MAP_PRIVATE, 3, 0) = 0x30000000
close(3) = 0
munmap(0x30000000, 22471) = 0
open("/usr/lib/locale/tr/LC_COLLATE", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=22471, ...}) = 0
mmap(NULL, 22471, PROT_READ, MAP_PRIVATE, 3, 0) = 0x30000000
close(3) = 0
munmap(0x30000000, 22471) = 0
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(3, 0), ...}) = 0
ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30000000
write(1, "could not set locale\n", 21could not set locale



Also I cannot understand why it is trying to open
"/usr/lib/locale/tr/LC_COLLATE" after finding "/usr/lib/locale/tr_TR/LC_COLLATE".
Does anybody have an idea??
 
Old 02-04-2010, 04:03 AM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Hi ee5,

Welcome to LQ.

The locale files are not set up properly. You can also set the locale using export LOCALE='<locale>' Sometimes the directories are there, but they have incomplete contents. If you tell us which distro you use, we can tell you how to install one locale at a time.
 
Old 02-04-2010, 05:30 AM   #3
ee5
LQ Newbie
 
Registered: Feb 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you.

It is not a distribution, it is an embedded system running on powerpc-compiled and configured by myself. Also I have locale files cross-compiled for ppc. /usr/lib/locale/tr_TR/ files and /usr/share/locale/locale.alias is copied, but I think that's not enough. Is there any other file that should be copied or do I have to compile locale library for one locale at a time?
 
  


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
php, debian and setlocale in french / russian spyros Programming 0 11-05-2008 09:28 AM
setlocale() returns NULL mic Programming 2 11-08-2005 03:49 AM
setlocale pantera Programming 1 07-06-2004 09:23 AM
When to use setlocale() ? biosx Programming 3 01-31-2004 06:04 AM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM

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

All times are GMT -5. The time now is 05:42 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
Open Source Consulting | Domain Registration