setlocale problem

Problems with the Linux version of XAMPP, questions, comments, and anything related.

setlocale problem

Postby Macuyiko » 23. August 2007 19:51

Hi, I'm having a problem with the following PHP function:

setlocale(LC_ALL,'en_US.utf-8');

It always returns false when using lampp-apache. setlocale(LC_ALL, 0) returns 'C'. No matter which locale I try to set, the function always returns false.

I tried executing system('locale -a'); to see if the locales where present on my system, they were.

I'm running xampp on Ubuntu. Note that when using the Apache/PHP installation provided by Ubuntu packages, the code works fine.

I've also tried setting the locale to something which was listed in /opt/lampp/share/locale/locale.alias. Which didn't work.

Any ideas any-one? (How can I force xampp to use my system locales instead of the /opt/lampp/share/locale ones?) I really need this function because otherwise all utf-8 characters with accents or umlauts get displayed as question marks (?). (This happens server-side and has nothing to do with browser-settings.)

Thanks
Macuyiko
 
Posts: 2
Joined: 23. August 2007 19:42

Postby Macuyiko » 23. August 2007 21:24

Bump: could anybody post a locale that should work with the default lampp installation. It seems the only working locale is the fallback "C"... I also tried copying my system locales to /opt/lampp/share/locale.
Macuyiko
 
Posts: 2
Joined: 23. August 2007 19:42

Postby skuipers » 24. August 2007 14:45

Have you tried to set a symbolic link from /opt/lampp/share/locale to /usr/share/locale?
skuipers
 
Posts: 102
Joined: 21. January 2005 16:27
Location: The Netherlands


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 101 guests